# Decode an x402 payment header

> Paste an x402 PAYMENT-REQUIRED, PAYMENT-SIGNATURE or PAYMENT-RESPONSE header and read it as JSON, field by field, with checks. It runs in your browser.

Canonical page: https://finray.tech/tools/x402-payment-header-decoder/
Publisher: Finray Technologies Ltd (finray.tech), unrelated to finray.io
Markets: United States, United Kingdom, European Union
Sources last verified: 2026-11-25

Paste an x402 header and see what it asks for or pays. You get the decoded JSON, each field in plain words, and checks on the amount, the recipient, the validity window and the nonce. It runs in your browser.

Checked in your browser. Nothing you type is sent, stored or put in the address bar.

## How it works

x402 puts a payment inside an HTTP request. The server asks in one header, the client pays in another, and the server reports the settlement in a third. Each carries base64 of JSON. The decoder finds out which object you pasted, shows it field by field and runs ten checks on its shape. It reads the header; it does not check what the header says against a chain.

| Check | Rule | Where it is written |
| --- | --- | --- |
| Version | Version 2 uses the headers PAYMENT-REQUIRED (server to client), PAYMENT-SIGNATURE (client to server) and PAYMENT-RESPONSE (server to client). Version 1 used X-PAYMENT, and its requirements came in the body of the 402 response. A v1 object gets a plain note on what changed. | x402 spec v2 HTTP transport; x402 spec v1 |
| Required fields | In v2 each requirement has scheme, network, amount, asset, payTo and maxTimeoutSeconds, and the payment required object carries resource. extra is optional. In v1 the amount is maxAmountRequired, and resource and description sit inside each requirement. | x402 spec v2; x402 spec v1 |
| Network | In v2 the network is written in CAIP-2: a namespace, a colon and a reference, such as eip155:8453. | x402 spec v2 |
| Amount | The amount is a string of digits in the asset's smallest unit (atomic units). The decoder shows it raw. Give the token's decimals to see a human amount; the page does not guess them. | x402 spec v2 |
| Recipient match | For the exact scheme on EVM networks the payload carries an authorization with from, to, value, validAfter, validBefore and nonce. The to address should equal the payTo the server asked for. | x402 exact scheme on EVM |
| Value match | The authorization value should equal the amount of the requirement. The decoder uses the accepted requirement inside the payload, or the payment required you paste in the second box. | x402 spec v2; x402 exact scheme on EVM |
| Validity window | validAfter and validBefore are Unix times. The decoder shows them as UTC dates and compares them with your browser's clock: not yet valid before validAfter, expired from validBefore. | x402 exact scheme on EVM |
| Time to pay | maxTimeoutSeconds is the longest the server allows to complete the payment. The decoder shows it in minutes. | x402 spec v2 |
| Nonce | The nonce is 32 bytes, written in hex as 0x and 64 hex characters. The token contract does not accept the same nonce twice. | x402 exact scheme on EVM; x402 guide |
| Signature shape | The signature is 65 bytes, so 0x and 130 hex characters. Only the length is looked at. | x402 exact scheme on EVM |

## The three headers

In version 2 the headers are these. The decoder also takes the JSON on its own, a bare base64 value, or a header line with or without its name.

| Header | Sent by | Base64 of |
| --- | --- | --- |
| PAYMENT-REQUIRED | Server, with the 402 response | PaymentRequired: what the server asks for. |
| PAYMENT-SIGNATURE | Client, when it repeats the request | PaymentPayload: the chosen requirement and the signed payment. |
| PAYMENT-RESPONSE | Server, with the served response | SettlementResponse: success, transaction, network and payer. |

## What the decoder does not do

It never verifies a signature and never talks to a chain or a facilitator. A header that passes every check here can still be refused, replayed or unfunded: the decoder cannot see the token contract, the payer's balance or whether a nonce was already used. It reads one header at a time, and it takes the clock of your browser as the time.

The meanings and checks follow the exact scheme on EVM networks. A payload for another scheme, or one that uses the Permit2 transfer method, is shown field by field, and the authorization checks wait.

## Examples

Each example loads a synthetic header into the decoder: zero addresses, a made-up nonce and a made-up signature.

### A v2 payment required

- Header: `PAYMENT-REQUIRED`
- Shows: `One accepted way to pay: 10000 atomic units on eip155:8453, to the zero address, within 60 seconds.`
- Result: All required fields are present and the network is in CAIP-2 form.
- Published in: Synthetic, built from the x402 spec v2 field list

### A v2 payment payload

- Header: `PAYMENT-SIGNATURE`
- Shows: `A payload that pays the 10000 atomic units asked for, to the same address.`
- Result: The recipient and the value match the requirement, the nonce is 32 bytes and the window is open.
- Published in: Synthetic, built from the x402 exact scheme on EVM

### A v2 payload with problems

- Header: `PAYMENT-SIGNATURE`
- Shows: `A payload that pays another address, 20000 units, with a short nonce and a window that has closed.`
- Result: The recipient, value, nonce and window checks fail, each with the two values side by side.
- Published in: Synthetic

### A v1 header

- Header: `X-PAYMENT`
- Shows: `A version 1 payload, with the network written as a name.`
- Result: The version note says the header is PAYMENT-SIGNATURE in v2.
- Published in: Synthetic, built from the x402 spec v1

## Where Finray does this for you

[Corebanq](https://finray.tech/platforms/corebanq/)

Corebanq has an MCP server.

AI agents can initiate payments through Corebanq.

The customer institution sets the limits and approvals for those payments itself, in the Corebanq Configurator.

[Corebanq](https://finray.tech/platforms/corebanq/) · [MCP for core banking](https://finray.tech/solutions/mcp-for-core-banking/)

## Related

- [x402 for AI agent payments, and where MCP fits](https://finray.tech/intelligence/x402-agent-payments/): How x402 puts a payment inside an HTTP request or an MCP tool call, and what an institution has to control.
- [Agentic payments for banks, EMIs and fintechs](https://finray.tech/solutions/agentic-payments/): How AI agents pay today and what the core of a bank or fintech has to control.
- [Core banking MCP server: tools and controls](https://finray.tech/notes/core-banking-mcp-server/): What each tool of an MCP server for a core banking system exposes, and the control it needs.
- [AI agent identity and MCP authentication](https://finray.tech/platforms/corefa/ai-agents/): How an agent's own credential is issued, scoped and withdrawn.
- [All Finray tools](https://finray.tech/tools/)

## Sources

Last verified 2026-11-25.

- [x402 Foundation, x402 Protocol Specification, protocol version 2](https://raw.githubusercontent.com/coinbase/x402/main/specs/x402-specification-v2.md)
- [x402 Foundation, x402 HTTP transport, version 2 (the three headers)](https://raw.githubusercontent.com/coinbase/x402/main/specs/transports-v2/http.md)
- [x402 Foundation, exact scheme on EVM networks (EIP-3009 authorization)](https://raw.githubusercontent.com/coinbase/x402/main/specs/schemes/exact/scheme_exact_evm.md)
- [x402 Foundation, x402 Protocol Specification, version 1](https://raw.githubusercontent.com/coinbase/x402/main/specs/x402-specification-v1.md)
- [Finray, x402 for AI agent payments, and where MCP fits (sources read 23 November 2026)](https://finray.tech/intelligence/x402-agent-payments/)

Not stated by the sources, and so not claimed here: the name of a v1 response header, the number of decimals of any token (enter it yourself), and what a facilitator does beyond what the guide says. The specification itself is the reference; if this page and the specification differ, the specification is right.
