JSON Converter
Convert JSON data online with JSON Lines parsing, record-path targeting, flattening controls, and exports for CSV, XML, Markdown, SQL, DOCX, and XLSX handoffs.Conversion Snapshot
| # | {{ header }} | Copy |
|---|---|---|
| {{ row.rowNumber }} | {{ cell }} | |
| No rows available. |
| Path | Types | Coverage | Example | Copy |
|---|---|---|---|---|
| {{ row.path }} | {{ row.types }} | {{ row.coverage }} | {{ row.example }} | |
| Path atlas appears after a successful transform. | ||||
| Risk area | Status | Evidence | Copy |
|---|---|---|---|
| {{ risk.category }} | {{ risk.status }} | {{ risk.detail }} |
{{ deckText }}
Introduction
JSON is a compact way to represent structured data, but compact is not the same as readable. A payload can be valid and still be awkward to inspect when the records you care about sit under wrapper objects, when arrays turn into sprawling columns, or when one export format is useful for people and another is useful for a system.
This converter handles that translation step. It accepts one JSON document or a JSON Lines stream, lets you aim at a nested branch with a record path, and then builds a Conversion Snapshot, a Record Grid, a Path Atlas, an Export Deck, and a Pretty JSON view from the selected data. That makes it useful for API responses, log samples, config snippets, and copied event data that need quick review before they move into another format.
The output range is broad enough to cover common handoff cases without forcing you to repeat the parsing work. The selected branch can be reviewed as formatted JSON, turned into JSON Lines, rendered as XML, or flattened into rows for CSV, TSV, HTML, Markdown, SQL, DOCX, and XLSX exports. If the useful records are buried under metadata, you can extract only that branch instead of exporting the entire root object.
Most processing stays in the browser after the page has loaded. Pasted text and dropped files are parsed locally, and the regular export formats are generated locally from that parsed result. XLSX export is the exception: when you request it, the page loads a spreadsheet helper library and then builds the workbook in the browser.
The main judgment call is how much structure to flatten. Flattening makes tables easier to compare, filter, and hand off, but it also changes how nested data is represented. The safest workflow is to confirm the selected branch and the risk badges first, then export the version that fits the next step in the job.
Technical Details
A JSON text can be any serialized JSON value, not only an object or array. That matters here because the converter will still work when the root is a single object, a number, a boolean, or a string. In strict JSON mode it parses one full JSON text. In strict JSON Lines mode it parses each non-empty line as its own JSON value. Auto detect tries ordinary JSON first and falls back to JSON Lines if the first parse fails.
Path resolution happens after parsing and optional recursive key sorting. Dot and bracket notation work well for paths such as items[0].records. Slash paths follow JSON Pointer rules, so /items/0/records reaches the same branch and escaped tokens such as ~1 and ~0 can represent literal / and ~ in key names. If the requested path does not resolve, the converter raises a warning and falls back to the root value instead of returning an empty result quietly.
The selected value becomes the working dataset. Arrays remain multi-record sets. A single object or scalar becomes a one-row result. From there, flattening can expand nested object keys into dotted headers and array positions into bracketed headers, or keep those subtrees as serialized JSON text when flattening is turned off for that branch type. Header names can stay as-is or be normalized to snake_case, kebab-case, or camelCase, and numeric suffixes are added automatically if two flattened fields would collapse to the same final header.
Risk telemetry is built from the parsed content before export. The tool measures record count, header count, payload depth, byte size, JSON Lines line count, and integer precision risks. Precision warnings are based on JavaScript's safe integer range, so a flagged value is not invalid JSON by itself; it is a sign that downstream number handling may stop being exact if a large identifier or counter is treated as a regular number.
JSON or JSON Lines input
-> parse and optionally sort keys
-> resolve root, dot path, or JSON Pointer path
-> selected branch
-> structured views: Pretty JSON, JSON Lines, XML
-> flat views: Record Grid, CSV, TSV, HTML, Markdown, SQL, DOCX, XLSX
-> audit views: Conversion Snapshot, Path Atlas, risk checks
| Stage | What the tool does | Why it matters |
|---|---|---|
| Input mode | Parses one JSON text, one JSON value per non-empty line, or tries both in sequence. | Lets the same editor handle API payloads and line-based event streams without manual reformatting first. |
| Record path | Selects the branch to inspect with dot/bracket notation or JSON Pointer syntax. | Prevents wrapper metadata from polluting the table when the real records sit deeper in the document. |
| Flattening | Expands nested objects and arrays into headers, or keeps them as serialized JSON inside cells. | Controls whether the result behaves more like a spreadsheet extract or a compact nested snapshot. |
| Header normalization | Preserves original headers or rewrites them as snake_case, kebab-case, or camelCase with collision suffixes. | Helps align output with downstream naming rules without losing distinct fields. |
| Risk checks | Flags unresolved paths, unsafe integers, very wide headers, and deep payloads. | Surfaces common export problems before you copy or download the transformed data. |
| Result view | Built from | Best use |
|---|---|---|
| Pretty JSON | The selected branch before flattening, with configurable indentation. | Truth-checking the exact branch you chose. |
| JSON Lines and XML | The selected records or branch, not the flattened table. | Passing structure forward while changing the wrapper format. |
| Record Grid, CSV, TSV, HTML, Markdown | Flattened rows and finalized headers. | Human review, spreadsheet work, and plain-text documentation. |
| SQL insert | Flattened rows with sanitized identifiers and dialect-aware literal formatting. | Quick staging into MySQL, PostgreSQL, or SQLite scratch tables. |
| Path Atlas and its DOCX export | The flattened header set plus type, coverage, and example data. | Auditing how often each field appears and what kind of values it carries. |
Everyday Use & Decision Guide
Auto detect is the safest starting point when the source is uncertain. It keeps routine paste-and-convert work quick, especially when data comes from logs, API consoles, or copied text where you do not want to stop and classify the format first. Switch to strict JSON only when the whole payload must succeed as one JSON text, or to strict JSON Lines when each line is supposed to stand alone and line-specific errors matter.
The record path is the choice that most strongly shapes the result. Leave it blank when the root already is the data you want. Add a path when the useful branch sits below envelope fields such as meta, items, or results. If you already have a slash path from another system, JSON Pointer mode keeps that notation intact. If you are typing the path by hand, dot and bracket notation is usually faster.
Flattening should follow the next destination, not a fixed rule. Turn object flattening on when nested fields need to become columns. Turn array flattening on only when the arrays are short and regular enough to compare row by row. For long tag lists, repeated measurements, or uneven nested arrays, keeping arrays as JSON strings often produces a far more useful table.
Presentation settings matter too. Null as blank can make exports easier to read, but it removes the visible difference between an explicit JSON null and an empty-looking cell. Header case normalization helps when a downstream database or script expects a particular naming style. Preview rows limit only the interactive grid, so trimming on screen does not mean the downloads were truncated.
| Situation | Good starting choice | Why it usually works |
|---|---|---|
| Wrapped API response with records below the root | Leave mode on auto and set a record path to the array you want. | Keeps the grid focused on actual records instead of repeating envelope fields. |
| Line-based logs or events | Use strict JSON Lines. | Each non-empty line is parsed separately, so errors point to a specific line. |
| Need a spreadsheet-style review | Flatten objects, then decide carefully on arrays. | Object columns usually help comparison; array expansion can become noisy fast. |
| Need a staging table | Normalize headers, pick the SQL dialect, and set the table name before export. | The SQL output reflects those naming and quoting choices directly. |
| Need to confirm the chosen branch before sharing anything | Check Conversion Snapshot, Path Atlas, and Pretty JSON first. | Those views show branch shape, field coverage, and the pre-flattened structure together. |
Step-by-Step Guide
- Paste the payload into the editor or drop a local text file onto it.
- Choose the source mode. Keep auto detect unless you need strict JSON or strict JSON Lines behavior.
- Enter a record path only if the useful records sit below the root value, and choose dot or pointer mode if auto is not the clearest fit.
- Set flattening, null handling, header case, and any XML or SQL naming options that matter for the next handoff.
- Run
Convert JSON, then read the Conversion Snapshot badges, warnings, Record Grid, and Path Atlas before exporting. - Use Pretty JSON when you need the selected branch in structured form, or use the Export Deck and grid exports when you need a flat handoff.
Interpreting Results
The first check is whether the selected branch is what you expected. Root type describes the original parsed value. Target type describes the branch reached after path resolution. If the root is an object and the target is an array, that often means you landed on the row set you wanted. If a path warning appears and the target still looks like the root, the converter has fallen back to the top-level value.
Record count and field count show how large the selected result becomes after flattening. A small record count with a very large field count usually means the path is too broad or array flattening exploded a nested list into many columns. In that case, the best fix is often to narrow the path or keep arrays as JSON strings instead of flattening them.
Precision warnings should be read as handling warnings, not syntax failures. JSON implementations can set practical limits on number range and precision, and common JavaScript number handling only keeps integer values exact within the safe integer range of plus or minus 9,007,199,254,740,991. If the tool flags unsafe integers, treat numeric identifiers and counters carefully before sending the data into spreadsheets, SQL loaders, or other systems that may coerce them again.
The Path Atlas adds another layer of meaning. Coverage close to 100% means a field appears on nearly every row. Low coverage signals a sparse or optional field. The example column is just one sample value, so use it as a quick hint rather than a full summary of the field. That makes the Path Atlas especially useful for checking whether a flattened table will be tidy or full of mostly empty columns.
| Signal | What it means | What to check next |
|---|---|---|
| Path not found | The requested branch did not resolve, so the root value was used instead. | Recheck the path syntax and compare root type against target type. |
| Unsafe integers | One or more parsed integers exceed JavaScript's safe exact range. | Keep identifier-like values as strings when exact digits matter. |
| Long integer strings detected | A quoted value looks like a very large integer. | Preserve it as text unless the next system explicitly supports big integers. |
| Wide header set | The flattened result generated many columns. | Review array flattening and confirm the selected branch is not too broad. |
| Preview limited | The on-screen grid stopped at the preview-row limit. | Use downloads for the full dataset, or raise the preview limit for review. |
Worked Examples
Example 1: extract records from a wrapped response
{
"meta": {"page": 1},
"items": [
{"id": 1, "name": "Ada", "role": "ops"},
{"id": 2, "name": "Grace", "role": "infra"}
]
}
Set the record path to items or /items. The target type becomes an array, the Record Grid shows two rows, and Pretty JSON confirms that the selected branch is the record list instead of the wrapper object. CSV, DOCX, and XLSX exports then reflect only the two item rows.
Example 2: review a JSON Lines event sample
{"event":"login","user_id":"9223372036854775807","ok":true}
{"event":"logout","user_id":"9223372036854775808","ok":true}
Use strict JSON Lines when each line must stand on its own. The converter counts the lines, keeps the quoted user_id values as strings, and warns that the digit strings are large enough to deserve precision-safe handling. That warning is useful when the next destination is a spreadsheet or SQL table where silent numeric coercion might change the value.
Example 3: build a quick SQL staging script from nested rows
{
"records": [
{"host": "api-01", "quota": {"rpm": 1250}, "labels": ["ops", "release"]},
{"host": "api-02", "quota": {"rpm": 980}, "labels": ["infra"]}
]
}
Set the path to records, keep object flattening on, and decide whether the labels array should expand into separate columns or stay as one JSON string cell. With snake_case headers and the right SQL dialect selected, the SQL export produces a quick insert script while the Path Atlas shows how often each flattened field appears.
FAQ:
Does the converter validate a JSON schema or business rules?
No. It checks parseability, path resolution, shape, and a few practical risk signals, but it does not claim that the payload matches a schema or a domain contract.
What happens if the chosen path is wrong?
The tool warns that the path was not found and uses the root value so you can still inspect the parsed payload instead of getting an empty result.
Does JSON Lines export use the flattened table?
No. JSON Lines export serializes the selected records before flattening. Flat formats such as CSV, TSV, HTML, Markdown, SQL, and the Record Grid are built from flattened rows.
Why did two headers get numeric suffixes?
After header normalization, two different flattened paths can collapse to the same final name. The tool adds suffixes such as _2 so both fields remain distinct.
Does XLSX export require anything extra?
Yes. The workbook is still built in the browser, but the page fetches a spreadsheet helper library when you request XLSX output.
Glossary:
- JSON Lines
- A line-based convention where each non-empty line is its own JSON value.
- JSON Pointer
- A slash-based way to identify a value inside a JSON document, starting from the root.
- Flattening
- Turning nested keys into column-style paths such as
quota.rpmorlabels[0]. - Safe integer
- An integer that JavaScript can represent and compare exactly without rounding problems.
- Coverage
- The share of rows in the Path Atlas that contain a given field.
References:
- RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format, RFC Editor, 2017.
- RFC 6901: JavaScript Object Notation (JSON) Pointer, RFC Editor, 2013.
- JSON Lines, JSON Lines project.
- Number.MAX_SAFE_INTEGER, MDN Web Docs.