CleanThisText guide
Format and validate JSON safely
Separate syntax validation from schema checks and understand changes caused by reserializing JSON.
Start with JSON, not a JavaScript object
JSON requires double-quoted property names and strings. Comments, trailing commas, single-quoted strings, undefined, and functions are not valid. Objects are not the only valid roots: arrays, strings, numbers, booleans, and null are also allowed.
Use JSON Validator for a syntax check, JSON Formatter for selected indentation, and JSON Minifier for an unindented representation. A parsing error calls for inspecting the source, not guessing missing data.
Parsing can change more than whitespace
Formatter and Minifier use JSON.parse followed by JSON.stringify. Duplicate object keys collapse to the last value. Very large numeric identifiers may lose precision, numeric-looking keys can reorder, and escapes may be written differently.
Keep the original when exact bytes matter, especially for signed payloads. Store long identifiers as strings when the receiving schema expects strings. These tools are not lossless source editors.
Validate meaning at the receiver
A syntax-valid document can still have missing fields, wrong types, or unsupported values. Use the API's schema validator or test environment to check those requirements; this tool knows no application-specific schema.
For an error, inspect quotes, commas, brackets, and prefixes copied from logs. Error wording can vary by browser. Formatting does not make an access token safe to publish in a shared example.
Worked example
Input
{"name":"Ada","active":true}Result
{
"name": "Ada",
"active": true
}Two-space indentation exposes the fields. It does not establish that an API accepts these field names or values.
- Indent spaces:
- 2
For the next step
Simple hardware for an offline draft workflow.
Optional picks for moving paper notes into a file and writing through a revision.

MUNBYN portable scanner
A handheld scanner option for bringing paper notes and pages into a digital workflow.
View on Amazon
GLENCREAG RK104 retro mechanical keyboard
A full-size mechanical keyboard option for long cleanup, formatting, and writing sessions.
View on AmazonAs an Amazon Associate I earn from qualifying purchases.
All referenced CleanThisText tools process pasted text locally in browser memory. Read the privacy explanation.