To minify JSON in Notepad++, paste the complete document into JSON Minifier, review the compact result, and copy it back into Notepad++. This browser-assisted method parses strict JSON before serializing it without indentation instead of deleting whitespace with a regular expression.
Parsing, validation, serialization, display, and copying all happen in the current browser tab. The input is not uploaded to Lizely or sent to an API, so the workflow is suitable for request bodies, configuration snippets, API fixtures, embedded examples, logs, test cases, and other data you need to prepare for transport. Try the JSON Minifier to do this in your browser.

What JSON minification actually changes
Only JSON whitespace outside strings is insignificant. Spaces, horizontal tabs, line feeds, and carriage returns between JSON tokens can be removed, but the same characters inside a quoted string are data. The JSON Minifier follows a parse-then-serialize model: native JSON.parse establishes the value, and native JSON.stringify emits one compact representation without indentation.
That distinction prevents a general “remove spaces” operation from damaging string contents. It also means minification is not the same as gzip compression, schema validation, key sorting, field removal, array deduplication, or secret redaction.
- Formatting whitespace outside strings is removed.
- Spaces, escaped tabs, punctuation, and escaped line breaks inside strings remain part of the decoded value.
- Array order is preserved.
- Object member insertion order follows JavaScript parsing and serialization behavior.
- Number spelling may be canonicalized, but unsafe numeric changes are rejected.
| Method | Validation behavior | Main risk |
|---|---|---|
| Notepad++ Replace All with a whitespace expression | Does not understand JSON string and structure boundaries. | Can remove meaningful characters or fail to remove every formatting space. |
| Third-party Notepad++ plugin or macro | Depends on the installed implementation. | Different plugins may apply different duplicate-key, number, and size rules. |
| JSON Minifier browser workflow | Uses strict parsing plus explicit duplicate-key and numeric-safety checks. | Compact serialization can change number spelling, so the result still needs review. |
An in-editor plugin can be convenient when its parsing and safety behavior are documented. Verify that it uses a real JSON parser rather than regular expressions, and check how it handles duplicate keys, large numbers, and deeply nested input before replacing a file.
Minify JSON in Notepad++ step by step
- Open the file and keep a backup. Load the JSON document in Notepad++, then use Save As to create a readable copy before changing the working file. This gives you an easy rollback if the compact output is not suitable for the destination.
- Copy the complete JSON value. Press Ctrl+A and Ctrl+C to select and copy the document. Select only the JSON value: a complete object, array, string, number, boolean, or null. Do not include comments, trailing text, or JavaScript code because the minifier accepts strict JSON only.
- Paste it into JSON Minifier and review the count. Open the JSON Minifier, paste the copied text into the input area, and check the displayed input character count. Empty input is rejected, and the input limit is exactly 1,000,000 UTF-16 code units. The exact boundary is accepted; one more code unit is rejected without truncation.
- Run the minification. Select Minify JSON. The tool parses the complete input, checks it against its safety rules, and then produces compact text through the JSON.parse and JSON.stringify workflow.
- Fix any reported error in Notepad++. A strict-syntax, duplicate-key, unsafe-number, nesting, or budget error must be resolved before the operation can complete. Return to Notepad++, correct the source, and paste it again. Editing the input clears the old result, error, reduction summary, and copy status, so an earlier successful output cannot be mistaken for the result of the current input.
- Confirm the compact output and reduction summary. Inspect the complete result before copying it. The reduction summary tells you how many characters were removed; it does not prove that the document matches an application-specific schema or that the smaller payload is accepted by a particular API.
- Copy the entire output and replace the Notepad++ text. Select the copy control, return to Notepad++, select the original JSON, and paste the complete compact output over it. Save the file. If clipboard permission is denied, the output remains visible so you can select and copy it manually.
Fix validation failures before retrying
The minifier rejects input that could hide a data change or exceed its processing limits. Read the error category and correct the underlying source rather than attempting to remove characters manually.
| Error category | What it means | What to do |
|---|---|---|
| Strict syntax | The text is not valid strict JSON. Comments, trailing commas, single-quoted strings, unquoted property names, hexadecimal numbers, leading plus signs, Infinity, NaN, undefined, functions, and sparse-array syntax are rejected rather than repaired. | Convert the source to strict JSON in Notepad++ or use JSON Formatter or JSON Validator to locate syntax problems, then paste the corrected value again. |
| Duplicate object key | The same decoded key appears twice within one object. Escape-equivalent names count as duplicates. | Rename or remove the conflicting member. The same key can still appear in different nested objects because those are separate scopes. |
| Unsafe number | Parsing could round an integer, overflow to a non-finite value, underflow a nonzero value to zero, or change an exact decimal value during serialization. | Use a supported number or encode an arbitrary-precision value as a JSON string. Use a purpose-built arbitrary-precision system when exact numeric behavior is required. |
| Nesting limit | The structure exceeds 256 levels of nesting. | Reduce the nesting depth or process the data with an application designed for that structure. |
| Character budget | The input is empty, the input exceeds its budget, or the compact output would exceed the independent output budget. | Reduce the JSON or use a workflow designed for larger files. Nothing is silently sliced, sampled, partially parsed, or partially returned. |
Both the input and output have independent 1,000,000-code-unit limits, and each exact boundary is accepted. Compact output will normally be shorter because formatting whitespace is removed, but the separate output check still prevents an oversized result from being returned silently.
Review the compact result before replacing the file
A successful parse confirms JSON grammar, not application correctness. Review property names, values, array order, and the fields your receiving system requires. The tool does not remove unwanted fields, sort object keys, deduplicate arrays, validate a schema, or make untrusted data safe to execute.
Numeric spelling can change even when the numeric value remains equivalent. For example, a token written as -12.5e+2 can be serialized as -1250. That is a canonical representation of the same JavaScript Number, not byte-for-byte preservation of the original token. Exact integer boundaries accepted by Number.isSafeInteger remain usable, but integers outside that range are rejected. Finite fractional values within the supported range follow normal ECMAScript Number semantics.
String preservation applies to the decoded value. A space, tab, punctuation mark, or line break inside a string remains data rather than being treated as removable formatting. That makes the compact output suitable for transport-oriented JSON, but the saved result should still be opened or parsed again after it is pasted into Notepad++.
Keep the readable source in Notepad++
For ongoing maintenance, keep an indented JSON file as the editable source and create a compact copy for transport or embedding. Use JSON Formatter when readability is the goal, or JSON Validator when the task is syntax-only diagnosis. Neither a smaller character count nor a valid JSON document guarantees that an API will accept the data, so review credentials and personal information before copying the result into another system.
For a deeper look, see How to Generate JSON Schema from JSON Data: Review Workflow.
For a deeper look, see JSON to CSV Example: Objects, Rows, and Output.