Understand raw JSON
What raw JSON is, what formatting and validation tools change, when a transformation preserves meaning, and where copy, paste and sharing can break it.
Raw JSON is JSON text as it is stored or sent: the exact characters a server returned, a file contains or a log line captured. It may be minified on one long line, indented, or inconsistently spaced. Developer text tools mostly do two things to it. They reformat it for reading, and they validate it against the JSON grammar. This review explains which of those changes keep the data's meaning, which can alter it, and when the untouched raw text is the better choice.
Is formatting raw JSON suitable for your use?
For reading, debugging and reviewing, pretty-printing is usually suitable. JSON treats whitespace between tokens as insignificant, so adding indentation and line breaks outside string values does not change the data a conforming parser produces. Validation is also low-risk because a validator reports problems rather than rewriting the input.
The main tradeoff appears when a tool parses the input and then writes it back out, rather than only adjusting whitespace. Re-serialization can change number formatting, escape sequences, key order and the handling of duplicate keys. The parsed values may be equivalent, but the text is no longer byte-identical, and in some cases it is not value-identical either.
Keep the original raw text when exact bytes matter. Examples include data covered by a signature, hash or checksum; payloads you are filing as a bug report or test fixture; diffs where unrelated formatting changes would hide the real change; and inputs containing very large integers or high-precision decimals. In those cases, use a formatted copy only for reading and keep the raw version as the record.
What a JSON formatter actually changes
A JSON formatter changes text, not presentation. Unlike a CSS style or a display setting, its output is a new string with different characters. A minified input and its pretty-printed form show the difference:
{"id":42,"name":"Café","tags":["a","b"],"active":true}
{
"id": 42,
"name": "Café",
"tags": [
"a",
"b"
],
"active": true
}
Only whitespace between tokens differs here. The keys, string contents, number, array order and boolean are unchanged, so both versions parse to the same data. Minifying reverses the process by removing that whitespace.
Some changes look cosmetic but are not neutral in every context:
| Change | Effect on parsed meaning | Watch for |
| Indentation and line breaks between tokens | None | Whitespace inside string values must be left alone |
| Minifying | None | Harder to read and to diff line by line |
| Sorting object keys | JSON objects are unordered, so values are the same | Software that depends on key order; noisier diffs |
| Rewriting escapes, such as \u00e9 to é | Same string after parsing | Byte length and encoding change; matters for signatures |
| Normalizing numbers, such as 1.0 to 1 or 1e2 to 100 | Same numeric value in most parsers | Systems that treat the original spelling as significant |
| Parsing large integers as floating-point numbers | Can change the value | Integers beyond what a double can represent exactly, a known issue in JavaScript |
| Collapsing duplicate keys | Can change which value survives | The JSON standard does not define a single behavior for duplicates |
Validation is a separate step. A strict validator checks the text against the JSON grammar. Common failures include trailing commas, comments, single-quoted strings, unquoted keys, and literal line breaks inside strings, which must be written as \n. Some editors and configuration formats accept relaxed variants such as JSON with comments or JSON5. Text that passes there may still fail a strict JSON parser, so check which grammar a tool validates against.
Character-level transformations from other text tools, such as reversing text or swapping letters for styled Unicode look-alikes, are not formatting. They change the structural characters and the key names, and the result is not usable as JSON.
Will formatted JSON survive copying and sharing?
The JSON itself is plain text, so formatting does not create a portability problem. The risk comes from the destination. Word processors, note apps and some chat or email clients can silently replace straight quotes with curly quotes, insert non-breaking spaces, wrap long lines or add a byte order mark. Any of these can make valid JSON fail to parse. Whether a specific application does this depends on its settings and version. This review did not test named applications, so verify your own destination by pasting the text back into a validator.
Code blocks, plain-text fields, files and attachments are generally safer ways to share JSON than rich-text bodies. When the recipient needs to run or parse the data, send the raw or minified text as a file. Send the pretty-printed version when the goal is for someone to read it.
For readability and accessibility, indented JSON is easier to scan visually and to compare line by line than one long minified line. How screen readers announce JSON, and whether a particular tool's collapsible tree view works with keyboard navigation and assistive technology, could not be confirmed from the available evidence. If accessibility matters, test the viewer with the assistive technology your readers use. Keep a plain indented text version available, since it does not depend on any interactive widget.
Search and editing are also affected. Searching formatted JSON for a string like "id":42 will miss "id": 42 because of the added space, so search for key names or values rather than exact spacing. Hand-editing indented JSON is easier, but validate again afterward, because a missing or extra comma is the most common error introduced by manual edits.
Before you paste data into a formatter
Raw JSON from real systems often contains tokens, credentials or personal data. A tool's appearance or marketing language does not show whether it processes input locally or sends it to a server, or what it keeps. No evidence about any specific tool's data handling was available for this review. For sensitive payloads, prefer a formatter that runs entirely offline, such as an editor feature or a command-line tool, or redact the sensitive values first.
Quick checklist
- Use pretty-printing to read and debug JSON; it changes only whitespace between tokens.
- Keep the original raw text when exact bytes matter: signatures, hashes, fixtures and bug reports.
- Check whether a tool re-serializes the data; if so, watch for large numbers, duplicate keys and rewritten escapes.
- Confirm whether a validator checks strict JSON or a relaxed variant.
- Share JSON as a file or code block, then confirm it still parses at the destination.
- Do not paste secrets into a formatter unless you know where the data goes.