All Tools

OP_RETURN Decoder

Read embedded data from Bitcoin transactions

Try an Example

OP_RETURN allows up to 80 bytes of arbitrary data to be stored in Bitcoin transactions

What is OP_RETURN?

OP_RETURN is a Bitcoin script opcode that allows users to embed arbitrary data into the blockchain. It creates a provably unspendable output, meaning the satoshis sent to it are effectively burned, but the data becomes permanently stored on every Bitcoin node.

The opcode was standardized in Bitcoin Core 0.9.0 (2014) to provide a clean way to store data without creating fake UTXOs that nodes would need to track forever.

How OP_RETURN Works

An OP_RETURN output starts with the opcode 6a (106 in decimal), followed by the data payload. When a Bitcoin node encounters this opcode, it immediately marks the output as invalid for spending, but still stores the data.

6a [length byte] [data up to 80 bytes]

The data can be anything: text messages, hashes, protocol identifiers, or encoded data for layer-2 protocols. Common uses include:

  • Counterparty - Asset issuance and transfers
  • Omni Layer / Tether - USDT and other token operations
  • OpenTimestamps - Document timestamp proofs
  • Colored Coins - Asset metadata
  • Messages - Personal notes, memorials, announcements

OP_RETURN Size Limits

The maximum data size for standard OP_RETURN outputs is 80 bytes. This limit was increased from the original 40 bytes in Bitcoin Core 0.11.0 (2015).

While larger OP_RETURN data is technically valid according to consensus rules, most nodes won't relay transactions with non-standard outputs, making 80 bytes the practical limit for most use cases.

Frequently Asked Questions

What is OP_RETURN used for?

OP_RETURN is used to embed arbitrary data into Bitcoin transactions. Common uses include timestamping documents, storing metadata for layer-2 protocols (like Omni/Tether), creating asset tokens, and leaving permanent messages on the blockchain.

How do I read OP_RETURN data?

Use this decoder tool: paste a transaction ID (txid) and it will fetch the transaction, find any OP_RETURN outputs, and decode the data as hex, UTF-8 text, and ASCII. You can also use blockchain explorers or Bitcoin Core's RPC interface.

Is OP_RETURN data permanent?

Yes. Once a transaction is confirmed, the OP_RETURN data is stored on every full Bitcoin node forever. It cannot be modified or deleted. This permanence makes it useful for timestamping and proof-of-existence applications.

How much does it cost to use OP_RETURN?

The cost depends on the transaction fee rate and the size of your data. An OP_RETURN output adds approximately 10 bytes (opcode + length) plus your data (up to 80 bytes) to the transaction size. At typical fee rates, this costs a few cents to a few dollars.

Can I embed images or files in OP_RETURN?

With only 80 bytes, you can't store meaningful images directly. However, you can store a hash (like SHA-256) of a file, which proves the file existed at that time. For larger data, protocols like Ordinals use a different method (witness data).

What's the difference between OP_RETURN and Ordinals?

OP_RETURN stores data in a transaction output (max 80 bytes). Ordinals inscribe data in the witness section of taproot transactions, allowing much larger content (up to ~4MB). OP_RETURN predates Ordinals and is simpler but more limited.

Why is the opcode called OP_RETURN?

In programming, "return" typically ends execution of a function. In Bitcoin Script, OP_RETURN immediately fails script validation, making any output using it provably unspendable. This was repurposed as a feature for data storage.

Can a transaction have multiple OP_RETURNs?

Technically yes, but standard relay policies only allow one OP_RETURN output per transaction. Miners may include transactions with multiple OP_RETURNs, but most nodes won't relay them, making it harder to get them confirmed.

Instant Bitcoin Transfers

Spark enables instant Bitcoin transfers without waiting for confirmations. Build apps with programmable money on Bitcoin.