01What is Structured Field Parser?
Many newer HTTP headers, such as Priority, Cache-Status and Signature-Input, are defined as Structured Fields. RFC 9651 gives them one shared syntax with three top-level types: a List, a Dictionary or a single Item. You have to know which type a header uses, because the same text can mean different things under each. Pick the type, paste the field value, and the tool parses it with the algorithms in section 4.2 of RFC 9651. Every bare item type is supported: integers, decimals, strings, tokens, byte sequences, booleans, and the Date and Display String types that RFC 9651 added over RFC 8941. Parameters, inner lists and duplicate keys are handled as the spec says, so a repeated dictionary key keeps its first position and takes the last value. When parsing fails, the error names the rule that broke and the character position. Common causes are a trailing comma, a decimal with more than three fractional digits, an integer with more than 15 digits, an uppercase key, or non-ASCII text inside a plain string. The output JSON uses the same nested-array layout as the HTTP working group's structured-field-tests suite, with one difference: byte sequences are shown as base64 rather than base32. Tokens, dates, display strings and byte sequences are tagged with a __type field so they stay distinct from strings and numbers. You can also go the other way. Edit the JSON and serialize it, and the tool applies section 4.1: decimals are rounded to three places using round-half-to-even, strings are escaped, display strings are percent-encoded as UTF-8, and out-of-range values are rejected. Limits: the tool parses only the value, not the header name, and it does not know which type a given header is registered as. If a header arrives on several lines, join the values with a comma and a space first. Everything runs in your browser.
Backend and HTTP library developers who build, debug or test headers defined with RFC 9651 Structured Fields. The tool runs entirely in your browser, so your data never leaves your device.
02How to use Structured Field Parser
- Choose List, Dictionary or Item to match the header's definition
- Paste the header value, without the header name, into the Field value box
- Read the parsed JSON, or the error message and position if parsing fails
- Click Edit as JSON to copy the result into the serializer box
- Change the JSON and click Serialize to field value to build a new header value
03Worked examples
- Input:
Dictionary: u=1, i - Result:
[["u",[1,[]]],["i",[true,[]]]] - The RFC 9218 Priority header. A key with no value is the boolean true.
- Input:
List: ("foo" "bar");lvl=5, ("baz"), token;q=0.9 - Result:
[[[["foo",[]],["bar",[]]],[["lvl",5]]],[[["baz",[]]],[]],[{"__type":"token","value":"token"},[["q",0.9]]]] - Two inner lists and a token, each with its own parameters.
- Input:
Item: %"This is intended for display to %c3%bcsers." - Result:
[{"__type":"displaystring","value":"This is intended for display to üsers."},[]] - A display string decodes percent-encoded UTF-8 bytes, so %c3%bc becomes ü.
- Input:
Item: :cHJldGVuZCB0aGlzIGlzIGJpbmFyeQ==:;created=@1659578233 - Result:
[{"__type":"binary","value":"cHJldGVuZCB0aGlzIGlzIGJpbmFyeQ=="},[["created",{"__type":"date","value":1659578233}]]] - Colons mark a base64 byte sequence and @ marks a date in Unix seconds.
- Input:
Item: 1.2345 - Result:
Decimal has more than 3 fractional digits (at position 6) - Structured Field decimals allow at most three digits after the point.
04Common use cases
- Checking why a server rejects a Priority or Cache-Status header you built by hand
- Reading the parameters inside a Signature-Input header while debugging HTTP Message Signatures
- Producing a correctly escaped header value from JSON for a test fixture
- Confirming that a decimal or integer stays within the limits RFC 9651 sets
- Learning how inner lists and parameters nest before writing your own parser
05Tips
- Check the header's RFC for its type: Priority is a Dictionary, for example
- Keys must start with a lowercase letter or *, so a capital letter anywhere in a key is an error
- Use a displaystring rather than a string for text with non-ASCII characters
- Whole numbers in JSON become integers; use the decimal tag if you need 1.0
06Related concepts
RFC 9651, RFC 8941, HTTP header, Priority header, Inner list, Display String.
Frequently Asked Questions
What is Structured Field Parser?
Structured Field Parser is a free, browser-based developer tool on AIDToolStack. Parse HTTP Structured Field headers (RFC 9651) as lists, dictionaries or items into JSON, see exact parse errors, and serialize JSON back, in your browser. It requires no installation or sign-up and works entirely in your browser.
Is Structured Field Parser free to use?
Yes. No sign-up, no fees and no usage cap.
Does Structured Field Parser store my data?
No. It runs in your browser; nothing is uploaded.