Recover, review, reshape

Turn almost-JSON into data you can trust again

Copied logs, AI output, hand-edited configuration, and fenced snippets often look like JSON while failing a strict parser. CodePrettify repairs common problems, shows what changed, and lets you continue into a visual transformation recipe.

  • Explicit repair report
  • Original stays unchanged
  • Ordered recipes
  • Local processing
JSON Repair and Transform showing messy input, repaired JSON, and a detailed repair report
Code fences, surrounding prose, unquoted keys, single quotes, Python values, and trailing commas are repaired with a visible report.
Repair example

Recover the useful payload without guessing silently

The repair tool is designed for recognizable JSON-like input. It does not invent missing business data or pretend an ambiguous document is correct.

Captured input

Valid intent, invalid JSON

The payload is wrapped in prose and a Markdown fence, uses JavaScript-style keys and quotes, and contains Python constants.

Captured application payload:
```json
{
  service: 'api-gateway',
  environment: 'production',
  enabled: True,
  regions: ['eu-north-1',],
  fallback: None,
}
```
Repaired JSON

Strict, parseable output

The result uses quoted keys and strings, JSON booleans and null, and no trailing commas.

{
  "service": "api-gateway",
  "environment": "production",
  "enabled": true,
  "regions": [
    "eu-north-1"
  ],
  "fallback": null
}
Review the report before using the result.

The workbench lists the repairs it applied. If the source is incomplete or semantically ambiguous, confirm the values against the originating system.

Hands-on repair tutorial

Recover a fenced Python-style payload without hiding the changes

Use the captured input above for this lesson. The important habit is to treat the repair report as evidence, not as a decorative success message.

  1. Open Repair & Salvage

    Choose More Actions → General tools → JSON Repair & Transform, or find it through the Command Palette. In the Windows app, it is also available from Tools. Select the Repair & Salvage tab.

  2. Load the exact source you received

    Paste the complete text, including surrounding prose and code fences, so the report can explain what it removed. If a compatible document is already open, choose Use document. Avoid hand-fixing the source first—you would lose the audit trail for those changes.

  3. Decide whether partial JSON Lines salvage is acceptable

    Leave Allow partial-record salvage off unless the input is JSON Lines and you deliberately accept dropping reported invalid records. With the option off, one bad record blocks the result. With it on, every excluded source line must be reviewed.

  4. Analyze, then read the repair list in order

    Choose Analyze & repair. For the sample, expect the report to mention the Markdown fence or surrounding text, quoted keys, converted single-quoted strings, Python booleans and null, and removed trailing commas. A change that extracts or semantically replaces content deserves more scrutiny than whitespace cleanup.

  5. Compare repaired values with their source meaning

    Verify that True became JSON true, None became null, and every string value remained unchanged. The tool can normalize recognizable syntax; only you can confirm that production, the region, and the enabled state are correct business values.

  6. Stop when the source is incomplete or ambiguous

    If the tool rejects truncated input, missing structural separators, unsafe numbers, excessive nesting, or another unbounded case, return to the producing system. A refusal is safer than a plausible-looking document assembled from guesses.

  7. Pass the reviewed result forward explicitly

    Copy or download the clean JSON when repair is the only goal. To reshape it, choose Use result in Transform. This creates a separate working result; it does not overwrite the original file or the text you pasted.

Repair review checklist

Before using a repaired payload in code, a database, or another tool, confirm all six points.

  • The extracted object or array is the payload you intended.
  • Every semantic literal replacement has the expected meaning.
  • No JSON Lines record was excluded without explicit approval.
  • Strings, IDs, timestamps, and numeric values survived unchanged.
  • The repaired output parses as strict JSON.
  • The source remains available for comparison or audit.
Common repairs

Problems the repair pass can recognize

Wrappers and noise

  • Byte-order marks
  • Markdown code fences
  • Surrounding prose
  • First balanced object or array

Quotes and keys

  • Single-quoted strings
  • Unquoted object keys
  • JavaScript comments
  • Raw controls inside strings

Trailing syntax

  • Trailing commas
  • A final semicolon
  • Recognized JavaScript literals
  • Recognized Python literals

JSON Lines

  • Record-by-record validation
  • Explicit partial-salvage opt-in
  • Discarded source-line reporting
  • Array result for transformation

Confidence signals

  • Every repair listed
  • Warnings beside the result
  • Lower confidence for extraction
  • Extra review for semantic replacement

Safety boundaries

  • Truncated or ambiguous input is rejected
  • No network requests
  • No mutation of the source
  • Bounded size, depth, and traversal
Transform example

Build a recipe and watch the result update

Once the input is valid structured data, add operations in order. Each step receives the result of the previous step, and the live output explains how many rows and steps remain.

JSON repair interface with input, repair report, and clean output
Repair produces a clean result and a human-readable list of changes.
JSON transformation recipe filtering administrators and sorting them by request count
A filter for role = Admin followed by descending request count returns two rows from six.
1

Filter the rows

Keep only records that match a field, comparison operator, and value.

2

Sort the result

Order matching rows by requests, timestamp, name, or another selected field.

3

Continue or export

Add another operation, copy the JSON, export it, or open the result as a new document.

Hands-on transform tutorial

Turn six usage records into a two-row admin report

Follow the recipe shown in the screenshot: keep administrators, order them by request volume, and retain only the fields needed for a short report. Each operation receives the result of the preceding step.

  1. Start from reviewed structured data

    Choose Use result in Transform after repair, or load valid JSON, JSON Lines, CSV, YAML, TOML, XML, or feed data. Confirm the live result shows the expected starting row count before adding operations.

  2. Add a Filter operation

    Choose Filter, select the role field, use the equality operator, and enter Admin. The field picker uses detected fields, types, and sample values to reduce typing mistakes.

  3. Read the intermediate result

    Confirm that only administrator rows remain and that the status reports two rows from the original six. If no rows match, inspect capitalization, value type, and field path before adding another step.

  4. Add Sort after Filter

    Choose Sort, select the request-count field, and use descending order. Because sorting runs after filtering, it orders only the two administrator records instead of doing work on rows that will be removed.

  5. Select the report fields

    Add Select fields and keep the user name, role, and request count. The output becomes smaller without changing the original source. Rename a field only when the downstream consumer requires a different key.

  6. Test operation order

    Move Select fields above Sort. If the selected fields no longer include the sort key, the later step cannot work as intended. Move it back and use this experiment to see why recipe order is part of the transformation.

  7. Export the result, not the recipe preview

    When the live result and row count are correct, copy, export, or open the transformed JSON as a new document. Keep the source and repair report until the output has been checked by its destination.

Expected result: two administrator objects, sorted from highest to lowest request count, containing only the fields selected for the report.

Recipe operations

Compose the transformation you actually need

Shape columns

Select fields, remove fields, or rename properties while keeping a readable step history.

Control rows

Filter, sort, limit, or remove duplicates from arrays of objects.

Reshape nesting

Flatten nested objects when downstream tools expect a simpler record shape.

Summarize data

Group rows and calculate aggregates for quick inspection or export.

Reorder safely

Move or remove steps and let the workbench recalculate the result from the original input.

Keep provenance clear

The source document remains intact. The transformed output is a separate result you explicitly copy, export, or open.

Failure guide

Understand when to repair, when to transform, and when to stop

What you seeWhat it meansBest next action
High-confidence formatting cleanupThe tool made bounded syntax changes such as removing a fence or trailing comma.Still review the report, then parse or transform the result.
Extraction or semantic-literal warningThe tool selected content from a wrapper or changed Python/JavaScript meaning into JSON.Compare each changed value with the source system.
Invalid JSON Lines recordOne physical record cannot be parsed safely.Fix the source, or opt into partial salvage only when losing the reported line is acceptable.
Incomplete transformation stepA required field, operator, value, or option is missing.Complete the step; the previous valid preview remains visible.
“No rows matched”A completed filter removed every row.Check field path, value type, spelling, and operation order, or remove that step.
Unsafe or truncated structureThe tool cannot recover strict JSON without guessing.Stop and obtain a complete payload from the producer.
FAQ

Repair and transform questions

Will the repair tool invent missing values?

No. It repairs recognizable syntax and wrapper problems. It does not fabricate domain values that are absent from the source.

Does repair overwrite the current file?

No. The original remains unchanged until you deliberately copy, export, or open the repaired result.

Can I transform an object as well as an array?

The available operations depend on the input shape. Row-oriented operations are most useful for arrays of objects; object and nesting operations apply where their required shape exists.

Can I reuse a recipe?

The workbench exposes the ordered steps in the active session. For repeatable automation outside the UI, copy the resulting data or translate the visible recipe into application code.

Related guides

Recover the payload before you rewrite it by hand

Paste the JSON-like text, inspect the repair report, and continue into a visible transformation workflow on your device.