The practical answer
Compare configuration keys, values, types and array order. Compare SQL rows and NULLs, not indentation alone. The sample account stays the string 0012. Filtering paid in the LEFT JOIN ON clause retains A and B; filtering in WHERE leaves only A.
Start with a five-field JSON acceptance check
This fictional configuration makes every value reviewable. Account 0012 is a string, not the number 12. Zero, false and null must not disappear because they look like “no value.”
- Open JSON formatter, paste the input and format it. If syntax fails, inspect quotes, commas and brackets before deleting a reported field.
- Compare each field: account is string 0012; retries is number 0; enabled is boolean false; note is null; tags is a two-item array ordered a then b. An empty string, a missing key and null differ.
- Only if the target needs YAML, use JSON/YAML conversion on a copy and check a round trip. Finish with the target parser and test environment rather than overwriting the source or experimenting in production.
{"account":"0012","retries":0,"enabled":false,"note":null,"tags":["a","b"]}Run the SQL counterexample: one moved condition removes a row
Run this complete script in a disposable SQLite database, never a business database. The editorial example has two customers: A has a paid order; B has none. The second query moves only the paid condition.
- To improve readability, put the SELECT statements into SQL formatter and retain before/after copies. Check that ON, WHERE and quoted content have not changed.
- Run each version against the same fixture. Expect two Q1 rows and one Q2 row. If B’s status looks blank, confirm that the client means SQL NULL rather than an empty string.
- Choose Q1 when the requirement is every customer with any matching paid order; choose Q2 when it is customer rows with a paid order. Repair the condition placement and rerun; restoring indentation alone cannot fix the result.
CREATE TABLE customers (id TEXT PRIMARY KEY);
CREATE TABLE orders (customer_id TEXT, status TEXT);
INSERT INTO customers VALUES ('A'), ('B');
INSERT INTO orders VALUES ('A', 'paid');
-- Q1: keep every customer
SELECT c.id, o.status
FROM customers c
LEFT JOIN orders o
ON o.customer_id = c.id AND o.status = 'paid'
ORDER BY c.id;
-- Q2: keep only rows with a paid order
SELECT c.id, o.status
FROM customers c
LEFT JOIN orders o ON o.customer_id = c.id
WHERE o.status = 'paid'
ORDER BY c.id;| Query | id | status |
|---|---|---|
| Q1 | A | paid |
| Q1 | B | SQL NULL |
| Q2 | A | paid |
SQLite’s SELECT documentation explains NULL-extended outer-join rows and subsequent WHERE filtering. This tiny exercise does not validate production queries, permissions or execution plans.
Check a small configuration field by field
Use this illustrative configuration: {"account":"0012","retries":0,"enabled":false,"note":null,"tags":["a","b"]}. After formatting or JSON→YAML→JSON, account should remain a four-character string, retries a numeric zero, enabled a Boolean false, note null, and tags a two-element array in the same order. Changing account to 12 or false to "false" is observable by an application; it is not a whitespace edit.
The JSON/YAML converter parses and regenerates the destination format. It does not preserve the source document as written. Keep YAML comments and anchor-based editing information in the original. Object-key order changes do not alone establish changed values, whereas array order can matter. If a signature depends on original bytes, preserve the original file: equivalent parsed data does not establish an equivalent byte signature.
| Field | Preserve | Unintended change |
|---|---|---|
| account | String "0012" | Number 12 |
| enabled | Boolean false | String "false" |
| note | null | Empty string or an omitted field |
| tags | ["a","b"] | Sorting or flattening into one string |
Add another order: rows are not unique customers
Add one more paid order for A to the same test database, then rerun Q1 and Q2. Q1 returns three rows: A twice and B once. Q2 returns two rows, both A. A join produces matching rows rather than automatically deduplicated customer counts. Define the counting unit before treating query rows as people in a report.
INSERT INTO orders VALUES ('A', 'paid');The current SQL tool uses general formatting without a database connection or dialect selector. Verify proprietary syntax, constraints and returned rows in the appropriate test environment.
Use small failure cases for regex and basic compaction
The regex tool currently uses fixed g, m and u flags. Compare ^cat$ against “cat” and “Cat” to expose case sensitivity; there is no i-flag control. The m flag makes anchors operate on individual lines, so include multiline input. Match positions are JavaScript string indexes, which need not equal visible glyph positions when emoji are present.
The reverse operation in the JavaScript tool performs basic text compaction using regular expressions, rather than full language-aware minification. The // inside const url = "https://example.com/a"; is string content that must survive. Keep the source and use the project’s normal build and tests instead of treating this output as a production bundle. Check CSS strings, URLs and rendered layouts too; a smaller file does not establish equivalent behavior.
Optional tools for a different input or next step
- Format JSON: Resolve syntax errors before formatting. Verify whether values such as "0012", 12, false and null retained their intended types.
- Convert JSON and YAML: Round-trip a small nested sample and inspect strings, arrays and nulls. Do not assume a converter preserves comments or YAML-specific features.
- Test a regular expression: Include a match, a near miss, an empty input and a multiline sample. This tool uses fixed g, m and u flags; inspect the exact matched boundaries before applying the pattern elsewhere.
- Format SQL: This tool formats generic SQL without a dialect selector. Review joins and filters independently, then verify specific syntax in the target database; formatting does not execute a query.
- Format or compact CSS: Keep an editable source, then preview affected layouts at narrow and wide widths; smaller source text does not prove visual equivalence.
- Format JavaScript: Compare the changed source and run the normal application checks. Basic compaction is not a guarantee of semantic equivalence or production optimization.
- Convert web color values: Use supported six-digit HEX or integer RGB input; HEX conversion also displays HSL. This entry does not provide opacity controls or a text-contrast check.
- Compare environment files: Compare variable names and added, removed or changed values. Keep masking on when exporting a review list and verify the destination environment separately.
Troubleshoot the layer that actually failed
MDN describes JSON parsing and syntax errors. Parsing establishes a narrower result than application correctness.
Follow the separate Schema and source-evidence checks for structured output. For prose mixed with code fences, inspect Markdown structure instead.
| Observation | Check first | Acceptance condition |
|---|---|---|
| JSON cannot parse | Quotes, commas, brackets; keep the source | Valid syntax and matching values/types for all five fields |
| 0012 changes through YAML | Lost string typing or quoting | Round-trip type checks and target parser pass |
| SQL loses B | Is paid in ON or WHERE? | The same fixture returns the business-defined rows |
| A URL breaks after JavaScript compaction | Comment stripping inside a string | Use syntax-aware build tooling and run the original tests |
Common questions
Does valid JSON satisfy a Schema?
No. Syntax, Schema and agreement with source facts are different checks.
Will YAML comments survive conversion?
Do not assume so. Keep the original and inspect features that the destination format cannot express.
Can formatting prove a regex is safe for all inputs?
No. Test representative boundaries and consider input size and execution behavior in the consuming application.
Further reading & sources
Put the guide into practice
Open the relevant tool, preview the result and check your exported file.


