Skip to content
uencoder
TASK

Format, validate, and repair malformed JSON

Take a JSON string (possibly minified, with trailing commas, or comments) and produce valid, indented JSON with error diagnostics.

  1. 1

    JSON from APIs is often minified for transport, and JSON from humans often has errors (trailing commas, single quotes, comments). Formatting makes it readable; validation catches structural errors before parsing fails in production.

  2. 2
    JSON Validator →

    Paste the JSON. The tool reports whether it is valid and, if not, the exact location and nature of the syntax error (unexpected token, missing comma, unterminated string).

  3. 3
    JSON Formatter →

    Paste valid (or valid-ish) JSON to re-indent it with 2 spaces, sort keys if desired, and normalize whitespace for consistent diffs.

  4. 4

    Use the chain to validate-then-format in one pass: if validation fails you get the error; if it passes you get formatted output.

Frequently asked questions

Why does my JSON with comments fail validation?
Standard JSON (RFC 8259) does not allow comments. Some parsers (JSON5, JSONC used by VS Code) accept them, but strict JSON does not. Strip comments before sending to a strict parser, or use a JSONC-aware parser.
Can the tool fix trailing commas automatically?
Strict JSON forbids trailing commas. The validator flags them; some formatters can strip them during formatting. However, automatic repair can mask real errors — always review the diff after any auto-fix.

Workflows that solve this

BLAKE Hash with CRC32 Checksum
Compute BLAKE hash then CRC32 checksum for integrity verification.
PIPELINE
Convert naming case and validate as JSON
Convert identifiers to a target naming convention, then validate the output as JSON to confirm structure.
PIPELINE
Compare two YAML configs via JSON
Convert YAML configs to JSON for diff-friendly comparison of structured values.
PIPELINE
Encode a JSON payload for URL transport
Prepare a JSON document for a URL parameter: pretty-print, Base64-encode, then percent-encode — the exact inverse of the nested-parameter decode chain.
PIPELINE
Hash text and verify with CRC32 checksum
Compute both a cryptographic SHA-256 hash and a CRC32 checksum for data integrity verification.
PIPELINE
HJSON to JSON Format
Format HJSON then convert to standard JSON.
PIPELINE
JS Format and JSON Validate
Format JS code then validate as JSON.
PIPELINE
Format JSON and compute integrity checksum
Pretty-print a JSON document and compute a CRC32 checksum to detect any subsequent modifications.
PIPELINE
Minify and validate JSON
Format JSON for inspection and validate it is syntactically correct in one pass.
PIPELINE
Generate JSON Schema and Validate
Generate a JSON schema from sample data then validate against it.
PIPELINE
Format JSON and generate TypeScript interface
Format a JSON document then infer a TypeScript interface definition in one chain.
PIPELINE
Validate, format, then convert JSON to YAML
Convert a (possibly minified) JSON config to YAML, catching syntax errors at the first node instead of producing subtly wrong YAML.
PIPELINE
JSON5 to JSON Format
Format JSON5 then convert to standard JSON.
PIPELINE
JSONC to JSON Format
Format JSONC (JSON with comments) then convert to standard JSON.
PIPELINE
Decode and format a JWT payload
Parse a JWT token, extract its payload, and format the JSON for inspection.
PIPELINE
Parse Query String and Format JSON
Parse query string into key-value pairs then format as JSON.
PIPELINE
SHA3-256 Hash with CRC32 Checksum
Compute SHA3-256 hash then CRC32 checksum for dual integrity verification.
PIPELINE
Convert TOML to JSON
Parse a TOML configuration file into JSON for tools and APIs that expect JSON input.
PIPELINE
Convert TOML to YAML via JSON
Transform a TOML configuration file into YAML format, using JSON as an intermediate representation.
PIPELINE
Decode nested URL parameter (Base64 JSON)
Unwrap a URL parameter that carries URL-encoded Base64 JSON into readable, formatted JSON.
PIPELINE
Generate TypeScript interfaces from YAML
Convert a YAML document to TypeScript interface definitions, using JSON as an intermediate format.
PIPELINE
Validate and format YAML
Convert YAML to JSON to validate its structure, then confirm the JSON is well-formed.
PIPELINE

Learn more

Want to understand why?

Related tools