Developer Tools
Logfmt Parser and Formatter
Parse logfmt logs into a structured table and convert JSON or NDJSON into clean logfmt with smart quoting. Heroku, Loki, and kit/log compatible.
Quick samples
Summary
Records
1
Errors
0
Blank lines
0
Unique keys
12
Key frequency
Parsed records
1 recordLine 1
Export
JSON for one record, JSON array for many, plus NDJSON.
JSON
{
"at": "info",
"method": "GET",
"path": "/users/42",
"host": "myapp.herokuapp.com",
"request_id": "cb84b9b6-7df0-4f2c-8c7e-2c0e8a5fbe3b",
"fwd": "203.0.113.7",
"dyno": "web.1",
"connect": "1ms",
"service": "42ms",
"status": 200,
"bytes": 512,
"protocol": "https"
}NDJSON
{"at":"info","method":"GET","path":"/users/42","host":"myapp.herokuapp.com","request_id":"cb84b9b6-7df0-4f2c-8c7e-2c0e8a5fbe3b","fwd":"203.0.113.7","dyno":"web.1","connect":"1ms","service":"42ms","status":200,"bytes":512,"protocol":"https"}Logfmt grammar reference
The shape every reader expects, summarized in one place. This tool follows the same rules so values round-trip cleanly between Heroku, kit/log, Loki LogQL, and Vector pipelines.
Keys
- Printable ASCII, no whitespace, no equals, no double quote.
- Cannot be empty.
- Used as JSON keys after a parse.
Values
- Bare values run from = to the next whitespace.
- Quoted values use "..." with \", \\, \n, \r, \t escapes.
- Empty values are allowed:
key=. - A bare key with no = is a boolean flag and parses to true.
Round-trip safe
- Quotes are added only when needed.
- Backslash, double quote, and control bytes are escaped.
- JSON arrays and nested objects are serialized as quoted JSON.
Reads like Heroku and Loki
- Mirrors the Heroku router log format.
- Works with the Grafana LogQL
| logfmtparser. - Matches the Go kit/log
logfmt.NewEncoderoutput.
How to use
- Pick a tab at the top: Parse logfmt to break log lines into structured records, or Build logfmt to go from JSON, NDJSON, or a row builder back to logfmt.
- In Parse mode, paste one or many logfmt lines and read the per-record table with key, value, and type hint badges; duplicate keys are flagged inline.
- Open the Summary card for total records, error and blank-line counts, and a key-frequency view that highlights which fields appear most often across the input.
- Use the Export panel to copy pretty JSON (single object or array) or NDJSON (one JSON object per line) so the result drops straight into jq, the Loki API, or a Vector source.
- In Build mode, paste JSON or NDJSON for an instant conversion or use the row builder; pick Auto, Always, or Never quoting per row to match the style your downstream parser expects.
About this tool
Logfmt Parser and Formatter is a browser workbench for the logfmt structured logging format popularized by Heroku and used by Grafana Loki LogQL, the Go kit/log encoder, Vector observability pipelines, Crystal Lang's log subsystem, Cloudflare Workers logs, and many internal SRE tools. The format is simply lines of key=value pairs separated by spaces, with double-quoted values when the value contains a space, equals sign, double quote, backslash, or control byte. The grammar is small but every implementation handles edge cases differently, so this tool follows the rules that Heroku, kit/log, and the LogQL logfmt parser agree on: printable-ASCII keys with no whitespace, no equals, and no double quote; bare values that run from = to the next whitespace; quoted values with backslash escapes for double-quote, backslash, newline, carriage return, and tab; empty values (key=) and bare-key flags (key alone) that parse to the empty string and true respectively; and duplicate keys where later occurrences overwrite earlier ones (matching Loki). Parse mode accepts any number of lines and returns one row per record, with each pair labeled by key, raw value, and a type hint (bool, integer, number, ISO timestamp, IPv4 or IPv6, UUID, URL, or plain text). Duplicate keys and parse errors (unterminated quoted values, stray characters where a key is expected, garbage after a closing quote) are surfaced with the exact line and column. The tool exports the parsed result as pretty JSON or NDJSON so you can pipe it into jq, the Loki API, or anything that wants one JSON object per record. Build mode goes the other direction: paste a single JSON object, an array of objects, or NDJSON and the tool emits clean logfmt with smart quoting, or fill out a row builder by hand with an Auto / Always / Never quoting switch per row so you can lock down the output format for tests. Key order from the source is preserved, nested arrays and objects are serialized as quoted JSON for round-trip safety, and invalid keys are dropped instead of silently breaking the wire format. Useful for SREs grepping Heroku logs, developers writing kit/log handlers, anyone building a LogQL query pipeline, and engineers writing tests that need to assert against a specific logfmt line. Everything runs in your browser. The logs you paste and the JSON you generate never leave the tab.
Free to use. Works in your browser. No signup, no login.
Related tools
You may also like
Access Log Parser
Parse Apache CLF, Combined, and NGINX access logs into a sortable, exportable table.
Open tool
DeveloperJSON Formatter
Format, minify, and validate JSON in your browser.
Open tool
DeveloperJSON Lines Formatter
Validate JSONL line by line, convert to and from a JSON array, and inspect record stats.
Open tool
DeveloperW3C Trace Context Parser
Decode traceparent and tracestate headers and build new ones with random IDs.
Open tool
DeveloperHTTP Headers Parser
Parse, classify, and decode HTTP headers, with a missing security headers audit.
Open tool
ConverterYAML to JSON Converter
Two-way YAML and JSON converter with anchors, flow, and block scalars.
Open tool