Protocols & Binary Serialization

ASN.1 decoderTrace every byte boundary

Paste one complete BER or DER value, choose its text encoding, then decode the TLV tree.

ASN.1 decoder

Encoded bytes

TLV tree

Enter bytes or load the example.

Bytes stay in this browser; no upload or URL storage.

Options

Enter bytes or load the example.

Use this ASN.1 decoder when a certificate, CSR or key blob fails in another parser and you need to see where the bytes actually stop. A readable certificate summary can hide a malformed length or a trailing octet; the raw structure cannot.

The ASN.1 decoder also provides a single-TLV builder for checking identifier and length encoding. It treats application and context tags as numbered tags, because their business meaning needs an external schema.

Why use this ASN.1 decoder?

Inspect the exact encoded structure before assigning it a certificate meaning.

One root, exact boundaries

The ASN.1 decoder shows every node’s start offset, header size and content length. A declared length beyond its parent, a missing BER terminator or bytes after the root becomes a concrete error rather than a partial success.

A short hexadecimal sequence branches into a SEQUENCE and INTEGER with their byte ranges marked.

Build and read back one TLV

Enter complete tag bytes and raw value bytes; the builder writes the definite length and passes the generated bytes through the same parser. Constructed tags require complete child TLVs, so a plausible-looking invalid payload is rejected.

A tag and value form a TLV byte strip that is then read back as a two-level tree.

Check the byte boundary before the field name

01

Choose the wrapper

Hex is the default. Switch explicitly to PEM or Base64 for textual wrappers; a local DER file is read as bytes. This avoids mistaking hex that also happens to be valid Base64.

  • A PEM input must contain exactly one matching BEGIN and END block.
02

Read the tree and offsets

Decoding is manual. Compare the selected node’s tag class, start offset, header length and content length with the source. BER indefinite lengths are accepted only on constructed values.

  • Ctrl/Cmd + Enter runs the current decode or build action.
03

Test a TLV without rewriting source

The build view writes a definite length from the value bytes. Use “Decode generated TLV” to preview replacing your decode input, then apply or undo the replacement.

  • Copy and download stay disabled whenever an input or option has made the result stale.

From raw bytes to inspectable nodes

Explicit input formats

Hex, Base64 and one PEM block are selected deliberately; local DER files never need to pass through a text encoding. The ASN.1 decoder reports malformed input before walking its tree.

Universal values, raw bytes retained

INTEGER, OID, strings and other clear universal types get a readable preview. Every selected node still exposes its tag and original content hex, including unknown application tags.

Bounded BER traversal

Constructed definite and indefinite BER values can nest, with a 256 KiB input, 32-level depth and 10,000-node ceiling. These limits keep damaged or hostile lengths from monopolizing the tab.

What a TLV tree can and cannot establish

Structure is not DER certification
The ASN.1 decoder accepts BER shapes, including constructed indefinite length. Successful parsing does not prove all DER canonical rules, SET ordering or a matching ASN.1 schema.
One complete root only
A second top-level object, extra PEM block, truncated length or missing end-of-contents marker is an error. No partial tree can be exported as a valid result.
No certificate trust decision
This ASN.1 decoder does not verify a signature, chain, expiry or private key. Those require certificate-aware validation rather than reading tag-length-value bytes.
No industry-specific TLV dictionary
A context tag such as [0] cannot identify an EMV or private protocol field by itself. OCTET and BIT STRING payloads remain bytes unless their own tag explicitly says constructed.

ASN.1 decoder questions

How is this different from a certificate decoder?

A certificate decoder names X.509 fields. This ASN.1 decoder shows generic tag, length, value and offset for any single BER/DER root, but does not assign certificate meaning or verify trust.

What does indefinite length mean?

BER permits a constructed value to run until an end-of-contents marker. DER forbids that form. The tree marks it as indefinite and requires the closing bytes.

Why does a node show [0] rather than a type name?

A context-specific tag number is only an identifier. Its meaning comes from the surrounding ASN.1 schema, which this generic viewer does not infer.

Is my file uploaded anywhere?

No. The local file and pasted bytes are read in this browser, with no network request or URL fragment containing the input.

Can I paste a full PEM certificate?

Yes, choose PEM and paste one matching BEGIN/END block. A chain containing multiple blocks is rejected, so select the one value you want to inspect.

Still have a question?

Open the ASN.1 decoder

Paste one BER/DER value or open a local file, then check each boundary before treating it as a higher-level object.

Parsing runs in this browser.