DevTools Logo

ASN.1 DER/BER Decoder

ASN.1 DER/BER Decoder

Inspect Tag-Length-Value bytes locally with a recursive tree and hex dump

Hex input

Spaces, commas, colons, hyphens, and 0x prefixes are accepted.

Paste hexadecimal DER or BER bytes to inspect recursive SEQUENCE and SET structures, decoded OIDs, signed integers, UTC times, and an offset-based hex dump.

Examples

RSA OID prefix

Input
decodeAsn1("30 0d 06 09 2a 86 48 86 f7 0d 01 01 01 05 00")
Output
{ type: "SEQUENCE", children: [{ value: "1.2.840.113549.1.1.1" }, { type: "NULL" }] }

The SubjectPublicKeyInfo prefix decodes to an RSA OID plus NULL parameters.

Indefinite BER with UTCTime

Input
decodeAsn1("30 80 02 02 01 00 17 0d 32 34 30 31 30 31 30 30 30 30 30 30 5a 00 00")
Output
{ length: null, children: [{ value: contains "256" }, { value: contains "2024-01-01T00:00:00.000Z" }] }

The indefinite SEQUENCE ends at 00 00 with an integer and an ISO-converted UTC time.

About this tool

ASN.1 DER Decoder parses hex with decodeAsn1(input) (alias parseAsn1Der): toBytes accepts spaced, colon, dash, or 0x-prefixed hex, then parse walks tag, length, and value into Asn1Node entries with tagClass, constructed, depth, headerLength, byteRange, and a hexDump row table.

Primitive values decode by universal type: signed big-endian INTEGER and ENUMERATED with hex, dotted OBJECT IDENTIFIER arcs, TRUE/FALSE BOOLEAN, NULL, BIT STRING unused-bits detail, UTCTime and GeneralizedTime ISO strings with the raw text, decoded strings, and hex OCTET STRING.

BER is supported alongside DER: 0x80 indefinite lengths require constructed values and end at 00 00, while truncated tags, lengths, arcs, and values throw offset-stamped errors and repeated decodes are deterministic.

How to use this tool

  1. Paste hex

    Provide DER or BER bytes as hex pairs with any common separator.

  2. Walk the tree

    Expand constructed SEQUENCE and SET nodes by depth and byteRange.

  3. Read values

    Copy OID dotted arcs, integer decimal plus hex, and UTCTime ISO timestamps.

Use cases

Inspecting certificates

Decode SPKI, OID, and time fields when debugging X.509 payloads.

Debugging BER streams

Confirm indefinite-length framing and EOC termination in network captures.

Diagnosing truncation

Use offset-stamped errors to find cut-off tags, lengths, or values.

Common mistakes

Mistake:Pasting odd-length hex and expecting padding.

Fix:Hex must hold complete byte pairs — add the missing nibble before decoding.

Mistake:Using indefinite length on a primitive.

Fix:0x80 requires a constructed tag, so wrap the value in a SEQUENCE or SET.

Frequently asked questions

What does this tool do?

It decodes DER or BER hex with decodeAsn1 into tagged nodes with depth, byte ranges, typed values, children, and a hex dump table.

How are OIDs, times, and BER handled?

OIDs render as dotted arcs like 1.2.840.113549.1.1.1, UTCTime converts to ISO with the raw text, and 0x80 indefinite lengths decode constructed values up to the 00 00 terminator.

Is my binary uploaded or stored?

No. Hex parsing and ASN.1 tree building run fully client-side.

Why a truncated or indefinite-length error?

Cut-off tags, lengths, and values throw offset-stamped errors, and indefinite length on a primitive tag throws because only constructed values may use it.

References & standards

.env Secret Safety Linter

Validate .env syntax and spot likely leaked credentials or placeholder secrets.

.htaccess Generator

Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth

2D Fluid Dynamics & Particle Physics Sandbox

A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.

AI Function Calling Schema Generator

Generate function calling JSON schemas from TypeScript interfaces

Algorithm Arena & Data Structure Visualizer

Interactive arena for algorithms and data structures: eight sorting algorithms racing on one seeded input, six pathfinding algorithms walking generated mazes, and BST, AVL, Red-Black, B-tree, heap and trie operations replayed step by step with rotations highlighted. Every run shows the Big-O table and the phase-highlighted reference implementation in four languages, and compared values can be played as pitch (sonification) through the shared audio engine. Everything runs client-side; inputs never leave the browser.

Ansible Playbook Generator

Build an Ansible playbook — hosts, vars, and tasks with modules — as YAML