All Tools View Categories About Contact Privacy

JSON to Log Converter

Turn structured JSON log objects back into readable text lines — bracket, plain, key=value or your own template.

Runs entirely in your browser — logs never leave this page.
Placeholders: {ts} {level} {category} {message} {fields}

About JSON to Log Converter

Structured logging is great for machines, but human beings still read logs. A JSON array full of nested objects is exactly what a dashboard wants and exactly what you do not want in a terminal while debugging at 2am. JSON to Log Converter is the reverse of a JSON log parser: it takes JSON log objects — from an API response, an audit export, a JSONL feed or a test fixture — and renders them back into familiar, greppable text lines.

Feed it a JSON array, a single object or JSON Lines and it parses everything automatically, detecting the format from the first non-whitespace character. The key mapping is smart but single: it scans the union of keys across your whole dataset once, picks the first match from a priority list of common names for timestamp, level, category and message (ts/timestamp/time/datetime, level/severity/lvl, category/logger/service, message/msg/log, in that order), and applies that same mapping to every record. The dropdowns are filled from the keys that actually appear in your data so you can correct any guess with one click — this matters most when your objects mix naming conventions (one service uses ts, another uses timestamp); pick whichever field the majority of your records actually use, or normalize your export first if the two never overlap. Any field that is not mapped to timestamp, level, category or message stays on the line as a key=value pair instead of being discarded, so you never silently lose data even when the mapping does not fit a given record perfectly.

Output is flexible: classic bracket lines like [2026-08-15 09:12:33] [ERROR] [api] login failed, plain space-separated lines, flat key=value lines with quoted, escaped messages that survive round-tripping through a shell or a second parser, or a fully custom template built from {ts} {level} {category} {message} {fields} placeholders for teams with their own house format. You can keep timestamps exactly as they arrived, normalize every one of them to ISO 8601 UTC regardless of source format, or compact them to a sortable YYYY-MM-DD HH:MM:SS form — numeric Unix timestamps in seconds or milliseconds are detected and converted automatically, and strings that Date can parse are normalized the same way. Everything runs locally in your browser: no log data is ever uploaded, so it is safe to paste real production exports, not just synthetic samples.

Features

  • Flexible input: JSON array, single object, or JSONL accepted and detected automatically from the first character.
  • Auto key mapping: timestamp, level, category and message detected from a priority list of common field names.
  • Manual override: dropdowns are populated live from the real keys in your data, not a fixed schema.
  • Bracket output: [ts] [LEVEL] [category] message lines like classic log frameworks (Log4j, Winston, Bunyan-style).
  • Plain output: simple ts LEVEL category message text lines for quick terminal reading.
  • Key=value output: flat lines that keep every field, with the message value quoted and escaped for safe re-parsing.
  • Custom template: compose lines with {ts} {level} {category} {message} {fields} placeholders to match any house format.
  • Timestamp control: keep raw, ISO 8601 UTC, or compact local style; Unix seconds/ms auto-detected and converted.
  • Level casing: normalize levels to uppercase, or keep them exactly as logged.
  • Unmapped fields preserved: anything not mapped to ts/level/category/message is appended as key=value, never silently dropped.
  • Local processing: all conversion happens in your browser, nothing uploaded, nothing stored.

How to Use

  1. Paste your JSON. Drop a JSON array, a single object or JSON Lines into the input box, or click Load sample to see it working end to end.
  2. Check the key mapping. The converter auto-detects timestamp, level, category and message keys from the union of fields in your data; adjust the four dropdowns if it guessed wrong or your field names differ.
  3. Pick an output style. Choose Bracket, Plain, Key=value or Custom template. For Custom, edit the template field using {ts} {level} {category} {message} {fields} placeholders.
  4. Tune formatting. Set the timestamp style (keep / ISO 8601 / compact) and whether levels are uppercased and extra fields are appended.
  5. Convert. Each object is rendered as one log line, with fields you did not map appended as key=value pairs unless you switch that off.
  6. Copy or download. Copy to the clipboard, download as a .log file, or use Save PDF to print the result.

Examples

Example 1 — Rebuilding a bracket log. A test harness stores events as JSON objects. Paste the array, keep the default mapping, pick Bracket output, and every event is restored to the [ts] [LEVEL] [category] message format the team greps for daily.

Example 2 — JSONL feed to readable lines. A log shipper emits one JSON object per line. Paste the feed, choose Plain output, and the stream becomes timestamp LEVEL category message lines that read naturally in a terminal.

Example 3 — Flat key=value export. An audit export uses nested objects. Pick Key=value output to produce flat, pipe-friendly lines that keep every field — id, action, actor, result — visible in one row, with the message safely quoted even if it contains its own " characters.

Example 4 — Custom template. Your ops runbook wants lines in the form error details: {message} [user={user_id}]. Use the custom template to render each object exactly the way the runbook specifies, with unmapped fields still available via {fields}.

Example 5 — Normalizing timestamps. A dataset mixes ISO strings and Unix milliseconds. Set timestamp style to ISO 8601 and every line gets a uniform, sortable timestamp regardless of the original encoding.

Example 6 — Mixed field names. If some records use ts and others use timestamp, the tool maps to whichever field wins priority; records using the other name keep their original field visible as a key=value pair instead of losing the timestamp, so you can spot the mismatch and fix it upstream.

Benefits

  • Humans first: JSON becomes the readable, greppable format operators actually want to scroll through.
  • Round-trip ready: pairs naturally with a JSON log parser for testing and building fixtures.
  • Zero guessing: key mapping dropdowns are filled from your real data, not a fixed schema.
  • Nothing lost: unmapped fields stay on the line as key=value pairs instead of being discarded.
  • Output flexibility: bracket, plain, key=value or a fully custom template to match your team’s conventions.
  • Safe key=value output: message text is quoted and escaped so the line survives a second parse.
  • Private by design: data is processed locally and never uploaded.

Frequently Asked Questions

What input formats are accepted?
A JSON array of objects, a single JSON object, or JSON Lines (one JSON object per line). The converter detects the format automatically and parses every object, then renders each one back into a log-style text line.
How are timestamp, level, category and message keys found?
Common key names are recognized automatically — timestamp, ts, time, datetime for dates; level, severity, lvl for levels; logger, service, category, component for categories; message, msg, log for the text. You can override any mapping with the dropdowns, which are populated from the actual keys in your data.
What output styles are available?
Bracket format like [2026-08-15 09:12:33] [ERROR] [api] message, plain timestamp LEVEL category message lines, key=value flat output, or a fully custom template with {ts}, {level}, {category}, {message} and {fields} placeholders.
What happens to extra fields?
Any key that is not mapped to timestamp, level, category or message is appended as key=value pairs. Toggle the switch off to drop them entirely, or pick key=value output to keep every field in the line.
Can I control the timestamp format?
Yes. Keep the original value, normalize to ISO 8601 UTC, or render a compact YYYY-MM-DD HH:MM:SS style. Numeric Unix timestamps (seconds or milliseconds) are converted automatically.
Is my data uploaded?
No. All parsing and rendering happens locally in your browser; nothing is sent to a server, stored or logged.