> ## Documentation Index
> Fetch the complete documentation index at: https://developers.stellar.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Data Formats

> XDR Format

### XDR Format

In the Stellar network, transactions are encoded using a standardized protocol called [External Data Representation](https://developers.stellar.org/docs/learn/fundamentals/data-format/xdr.md) (XDR).

In RPC, you will encounter XDR when [simulating](https://developers.stellar.org/docs/data/apis/rpc/api-reference/methods/simulateTransaction.md) and [sending](https://developers.stellar.org/docs/data/apis/rpc/api-reference/methods/sendTransaction.md) transactions, as well as when retrieving [transactions](https://developers.stellar.org/docs/data/apis/rpc/api-reference/methods/getTransactions.md), [ledgers](https://developers.stellar.org/docs/data/apis/rpc/api-reference/methods/getLedgers.md), and [ledger entries](https://developers.stellar.org/docs/data/apis/rpc/api-reference/methods/getLedgerEntries.md).

By default, RPC will return all XDR attributes as the machine-readable base64-encoded string. XDR-encoded response fields are usually suffixed with `Xdr`. You can decode this XDR on the Stellar Lab's [XDR page](https://lab.stellar.org/xdr/view?\$=network\$id=testnet\&label=Testnet\&horizonUrl=https:////horizon-testnet.stellar.org\&rpcUrl=https:////soroban-testnet.stellar.org\&passphrase=Test%20SDF%20Network%20/;%20September%202015;;).

### JSON Format

All RPC endpoints which return encoded XDR fields accept the `xdrFormat` attribute. This allows a client to change the response format to JSON, ultimately making it more human-readable. Note that you should not rely on any schema for the JSON, as it will change when the underlying XDR changes.

In the event that a `json` output format is requested, response fields suffixed with `Xdr` will be omitted and replaced with their `Json` suffixed counterparts.

```json Example getTransaction response theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  // xdrFormat = 'base64'
  "resultMetaXdr": "AAAAAwAAAAAAAAACAAAAAwAWuFYAAAAAAAAAAEBQYAimx5waQHaAptKgy2a/IAHMSe96ETt5wiMOSpKXAAAAF0JZ4rAAACHUAAekYwAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAAAAAAAAAAMAAAAAABa4VAAAAABnyjD0AAAAAAAAAAEAFrhWAAAAAAAAAABAUGAIpsecGkB2gKbSoMtmvyABzEnvehE7ecIjDkqSlwAAABdCWeKwAAAh1AAHpGQAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAADAAAAAAAWuFYAAAAAZ8ow/gAAAAAAAAAAAAAAAAAAAAA=",
  // xdrFormat = 'json'
  "resultMetaJson": {
    "tx": {
      "tx": {
        "source_account": "GCW2NGRNWISFIXSGCBXPU23GDBAMHIOQOWO52LZWEWNELRC4XDQMDWNT",
        "fee": 100,
        "seq_num": 58248347706520,
        "cond": {
          "time": {
            "min_time": 0,
            "max_time": 1741309515
          }
        },
        "memo": {
          "text": "6764203ea0bcd7058f922d32"
        },
        "operations": [
          {
            "source_account": null,
            "body": {
              "payment": {
                "destination": "GBZA3UPYFIFXXPH4QPQSFL73TZND7MEN744BLU4DPBR4T2XS526PRRN2",
                "asset": "native",
                "amount": 635808330
              }
            }
          }
        ],
        "ext": "v0"
      },
      "signatures": [
        {
          "hint": "5cb8e0c1",
          "signature": "cfcfc8192be1448b6c1e06265bd89b7375fdd818927f5167071d1e4f383522e6968771c91272fc248b4984f3f8c3ea7089396ab63c5dc557a45130c307f1840a"
        }
      ]
    }
  }
}
```
