Zero Signup ToolsFree browser tools

Developer Tools

W3C Trace Context Parser

Decode and validate W3C traceparent and tracestate headers in your browser. Extract trace-id, span-id, sampled flag, and vendor entries for OpenTelemetry.

W3C Trace Context Level 2

Paste one or more traceparent values. One per line. Lines that start with # are treated as comments.

Samples

1 header parsed

1 valid, 0 errors, 0 warnings.

  1. 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01

    Version
    00
    2 hex chars
    trace-id
    4bf92f3577b34da6a3ce929d0e0e4736
    16 bytes, 32 hex chars
    parent-id (span-id)
    00f067aa0ba902b7
    8 bytes, 16 hex chars
    trace-flags
    01
    8 bits

    trace-flags breakdown

    0x01 = 0b00000001 (sampled: yes, random-trace-id: no)

    1

    bit 0

    sampled

    0

    bit 1

    random-trace-id

    0

    bit 2

    reserved

    0

    bit 3

    reserved

    0

    bit 4

    reserved

    0

    bit 5

    reserved

    0

    bit 6

    reserved

    0

    bit 7

    reserved

Quick reference

traceparent shape

version-traceId-spanId-flags. For version 00 the value is exactly 55 characters: 2 + 32 + 16 + 2 hex chars plus 3 hyphens.

trace-flags bits

Bit 0 (0x01) = sampled. Bit 1 (0x02) = random-trace-id (Level 2). Bits 2-7 are reserved and must be ignored.

tracestate key forms

Simple: key. Multi-tenant: tenant@vendor. Keys are lowercase letters, digits, and _-*/ only.

tracestate limits

At most 32 entries, 256 bytes per entry. Total header should stay under 512 bytes so proxies do not strip it.

How to use

  1. Pick a tab: Parse traceparent for a single header (or a list), Parse tracestate for the vendor entries, or Build headers to compose a new pair from a form.
  2. On Parse traceparent, paste the header value (the leading "traceparent:" prefix is optional) and read the version, trace-id, span-id, and decoded trace-flags. Sampled and random-trace-id bits are shown as badges; reserved bits are flagged with warnings.
  3. On Parse tracestate, paste the comma-separated key=value list. Each entry is checked against the W3C grammar (lowercase keys, tenant@vendor multi-tenant form, value charset) with per-entry byte counts and total header size.
  4. Use the sample buttons to load valid and invalid examples (uppercase hex, all-zero IDs, too many entries) so you can see exactly which errors each one produces.
  5. On Build headers, click Generate random IDs to mint a 16-byte trace-id and 8-byte span-id, toggle the sampled and random-trace-id flags, paste any tracestate vendor entries, and copy curl, fetch, Node, OpenTelemetry JS, or Go snippets from the result.

About this tool

W3C Trace Context Parser decodes the traceparent and tracestate HTTP headers that propagate distributed traces across services. Paste a traceparent value and the tool splits it into version, trace-id, span-id, and trace-flags, then validates each field against the W3C Trace Context Level 2 grammar: 32 lowercase hex chars for trace-id, 16 lowercase hex chars for span-id, and an 8-bit flags byte with bit 0 (sampled) and bit 1 (random-trace-id) decoded into named badges. Common mistakes are caught and explained: uppercase hex, the reserved version ff, the all-zero trace-id and span-id, the wrong number of hyphen-separated fields, and the exact 55 character length rule for version 00. Paste a tracestate value and each comma-separated key=value entry is broken out with the simple-key versus tenant@vendor grammar, the value charset (printable ASCII without commas or equals), the per-entry 256 byte limit, the 32 entry maximum, and the 512 byte soft cap that proxies use to decide whether to forward the header. Duplicate keys, stray commas, oversized values, and uppercase keys all surface as targeted errors so you know exactly which entry to fix. The Build tab composes a traceparent from a small form (with a Generate random IDs button that mints a fresh trace-id using crypto.getRandomValues), lets you toggle the sampled and random-trace-id bits, and accepts an optional tracestate payload. Copy-ready snippets for curl, JavaScript fetch, Node.js https, the OpenTelemetry JS propagation.extract API, and Go OTel HeaderCarrier injection are produced live so you can drop a working request into the codebase you are debugging. Useful for developers integrating OpenTelemetry into a new service, SREs reading log lines that include only the raw traceparent, vendors implementing W3C propagation, and anyone debugging why a downstream service is starting a new trace instead of joining the parent. Everything runs locally; the headers you paste, the random IDs you mint, and the snippets you copy never leave your browser.

Free to use. Works in your browser. No signup, no login.

Related tools

You may also like

All tools
All toolsDeveloper Tools