Key-value text parser
Turn pasted labels, headers, metadata dumps, form exports, or key=value notes into structured JSON with duplicate grouping, record splitting, comments, key normalization, and safe type inference.
About this tool
Key-value text shows up everywhere: pasted HTTP headers, form exports, scan metadata, support tickets, email snippets, invoice notes, and configuration fragments. They are easy for humans to read but annoying to feed into scripts because each source chooses its own separator, repeats fields in different ways, and mixes useful lines with headings or comments.
This parser turns that messy text into JSON. It understands key: value, key=value, tab-separated rows, pipes, or a custom separator like ->. By default it skips prose lines, trims whitespace, removes one matching pair of quotes around values, and groups repeated keys into arrays so information is not silently overwritten.
Choose records when blank lines separate people, products, or tickets. Choose pairs when order and source line numbers matter more than a folded object. Turn on type inference only when you want unquoted true, false, null, and safe numbers to become real JSON values — IDs with leading zeros stay strings.
Worked example
Input:
Title: Quarterly report
Owner: Ada
tag: finance
tag: draft
Reviewed = false
With duplicate grouping, snake_case keys, and type inference enabled, output is:
{
"title": "Quarterly report",
"owner": "Ada",
"tag": [
"finance",
"draft"
],
"reviewed": false
}
For multiple records, put a blank line between blocks:
name: Ada
role: engineer
name: Grace
role: admiral
and select Blank-line records to get:
[
{
"name": "Ada",
"role": "engineer"
},
{
"name": "Grace",
"role": "admiral"
}
]
Options and limits
- Up to 10,000 input lines per run.
autoseparator uses whichever of:or=appears first on each line, so URLs such ashttps://example.test/a=bstay in the value when the first separator is the colon after the key.- Duplicate-key policies are
group,last,first, anderror. - Comment prefixes are comma-separated and match after leading whitespace. The default skips lines beginning with
#,;, or//. - Type inference is conservative: leading-zero IDs and
+15551234-style phone numbers remain strings. - The parser is line-oriented. It does not try to parse full YAML, TOML, INI sections, quoted multiline values, or nested objects.
FAQ
How is this different from a YAML or TOML parser?
YAML, TOML, and INI parsers expect a formal file format. This tool is for loose pasted text where some lines are headings, some are comments, and the same key may appear several times. It extracts the simple key separator value lines and makes a predictable JSON object, record array, or pair list.
What happens when the same key appears more than once?
The default is to group repeated keys into an array in the order they appeared, so tag: finance followed by tag: draft becomes "tag": ["finance", "draft"]. You can instead keep the first value, keep the last value, or fail with an error on the duplicate line.
When should I use records instead of object output?
Use records when blank lines separate repeated entities, such as people, tickets, products, or scanned documents. Each block becomes its own JSON object. If your input is one continuous block, object output is simpler.
Does type inference change IDs or phone numbers?
It only converts values that are clearly safe: booleans, null-like words, and ordinary numbers. Values with leading zeros or a leading plus sign stay strings so ZIP codes, IDs, and phone numbers are not damaged.
Can I preserve every original line?
Choose Ordered pairs with line numbers. That output shape keeps one { "key", "value", "line" } object per parsed pair, preserving order and source line numbers. Lines without separators are still skipped unless you set unmatched lines to error.
Developer & Automation Access
Run it from the terminal
Same engine as this page, headless — via the gizza CLI:
gizza tool keyvalue-text-parser "Name: Ada Lovelace
Role = engineer
tag: math
tag: computing"New to the CLI? Get gizza →
Open it by URL
Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:
https://gizza.ai/tools/keyvalue-text-parser/?input=Name%3A%20Ada%20Lovelace%0ARole%20%3D%20engineer%0Atag%3A%20math%0Atag%3A%20computing&separator=auto&custom_separator=-%3E&structure=object&duplicates=group&trim=true&unquote=true&comment_prefixes=%23%2C%3B%2C%2F%2F&infer_types=true&key_case=as-is&unmatched=skip&indent=2Machine-readable descriptor: tool.json — title + parameters JSON Schema for agents.
