Convert data to JSON format
What converting data to JSON actually changes, where meaning can be lost, how the result behaves after copying or sharing, and when plain text is the better choice.
Converting data to JSON is useful when the result will be read by software. It is less useful when the result will be read by people. This review looks at what the conversion changes, where meaning can slip during the process, and how JSON output holds up once it is copied, pasted or shared. No specific converter was tested for this article, so it covers general behavior defined by the JSON format and common conversion patterns rather than any one tool.
Is converting to JSON the right choice for your use?
The main benefit is structure. JSON gives data explicit fields, nesting and a small set of types, so programs, APIs, configuration systems and validators can process it predictably. The main tradeoff is that the conversion is only as faithful as its decisions about types and structure. A converter has to guess whether a value is a number or text, whether repeated items form a list, and what to do with anything JSON cannot represent directly.
- JSON is a good fit when:
- the destination is an API, script, database import, configuration file or another program that expects JSON
- the data has a clear record-and-field shape, or nests naturally
- you can validate the output and spot-check values before relying on it
- Plain text, or a simple table, is usually better when:
- the main audience is people reading on screen, in email or in a document
- the content is mostly prose, with little repeated structure
- the destination is a chat app, word processor or form that may alter punctuation
- the data includes values whose exact form matters, such as codes with leading zeros, and you cannot control type handling
What the conversion actually changes
Converting to JSON is serialization. It rewrites the stored characters of your data into a defined syntax. It is not a visual effect. Unicode "font" styling, mirrored or reversed text, and CSS presentation alter how text looks or swap characters for look-alikes. A JSON conversion adds braces, brackets, quotation marks, commas and escape sequences, and it organizes values into objects (named fields) and arrays (ordered lists). The underlying values are meant to stay the same. Only their representation changes.
JSON supports six kinds of value: objects, arrays, strings, numbers, true or false, and null. Anything outside that set must be mapped onto it. That mapping is where meaning can change.
| Source feature | What JSON does with it | Risk to meaning |
| Numbers with leading zeros (ZIP codes, account codes) | Valid JSON numbers cannot have leading zeros, so the value must become a string or lose the zeros | A converter that infers numbers can turn "02134" into 2134 |
| Very large integers or long IDs | JSON allows them, but many parsers read numbers as double-precision floating point | Integers above 2^53 may be silently rounded when parsed in JavaScript and similar environments |
| Dates and times | No date type; usually stored as strings | Format and time zone depend on the converter's choice |
| Empty cells or missing fields | Can become "", null or an omitted key | Each option means something different to the receiving program |
| Repeated XML elements or CSV columns with the same name | Arrays or duplicate keys | JSON says object names should be unique; parsers handle duplicates inconsistently, often keeping only one value |
| XML attributes, namespaces and mixed text | No direct equivalent; converters invent conventions | Structure may not round-trip back to the original |
| Comments | Not allowed in standard JSON | Comments are dropped or the output is invalid |
| NaN, Infinity | Not valid JSON numbers | Converted to null or strings, or cause errors |
Character content inside strings is preserved, but some characters must be escaped. Quotation marks, backslashes and control characters such as tabs and line breaks get a backslash form. Non-ASCII text, including emoji and accented letters, may appear either as literal characters or as \u escapes. Characters outside the Basic Multilingual Plane, which covers most emoji, become a pair of escapes when escaped. Both forms parse to the same text, so a change in appearance here does not mean a change in meaning. Right-to-left text is stored in logical order like any other string. Editors that mix it with JSON punctuation can display it in a confusing order, but the stored value is unaffected.
Pretty-printing and minifying are a separate, safe kind of change. Whitespace between JSON tokens has no meaning, so adding indentation for readability or removing it to save space leaves the data identical. Whitespace inside string values is part of the data and is kept.
An illustrative example
The sample below is constructed to show the type-inference problem. It does not come from any particular tool. Start with a one-row CSV file:
id,name,zip,active
7,Ana Ruiz,02134,true
A converter that guesses types aggressively could produce the output below. The ZIP code has lost its leading zero:
[
{
"id": 7,
"name": "Ana Ruiz",
"zip": 2134,
"active": true
}
]
A version that preserves meaning keeps the code as text:
[
{
"id": 7,
"name": "Ana Ruiz",
"zip": "02134",
"active": true
}
]
Both outputs are valid JSON, so a validator will not catch the difference. Only a comparison against the source data will. CSV itself has no types, which means every typed value in the output reflects a decision made by the converter. If a tool cannot treat all values as strings or set types per column, check codes, IDs and phone numbers by hand.
Will the result stay readable and usable after copying or sharing?
JSON is strict, so small changes introduced during copying can make it unparseable. The most common causes are general behaviors of text-handling software, not faults in any one tool:
- Curly "smart" quotes: word processors and some messaging apps replace straight quotation marks, and JSON only accepts straight double quotes.
- Non-standard whitespace: JSON permits only space, tab, line feed and carriage return between tokens. A non-breaking space picked up from a web page or rich-text editor breaks parsing.
- Trailing commas and single quotes: these are often added by hand edits and are invalid in standard JSON, even though some JavaScript-like formats accept them.
- Byte order marks: the JSON standard says encoders must not add one, though parsers may ignore it. Some tools reject files that start with one.
- Encoding: JSON exchanged between systems is expected to be UTF-8. Saving with another encoding can corrupt non-ASCII characters.
- Truncation: chat apps, form fields and preview panes may cut long text, which leaves unbalanced brackets.
Run the output through a validator after each copy or hand edit, not just once after conversion. Sending JSON as a file attachment, or inside a code block where the destination supports one, avoids most punctuation substitution.
For accessibility, JSON is a poor format for people who are not working with the data in code. Screen readers can read it, but brackets, quotes and commas are announced or skipped depending on the screen reader and its punctuation settings, and nesting depth is hard to follow by ear. No screen reader was tested for this article, so treat that as a general caution rather than a measured result. Indentation helps sighted readers, but it carries little information through speech. When people need the content, provide a plain-text summary or a properly marked-up table alongside the JSON.
For search and editing, JSON is written for machines. Its field names and values are not a substitute for readable copy on a page. Editing it by hand is workable in an editor with syntax checking and error-prone in plain text fields.
Choosing a free JSON converter
Because no specific converters were evaluated, this section lists what to check, not which tool to pick:
- Type control: can you keep values as strings, or set types per column, instead of relying on automatic guessing?
- Handling of empty values: does it output "", null or omit the key, and can you choose?
- Structure options: for CSV, can it produce an array of objects versus an array of arrays? For XML, is the treatment of attributes and repeated elements documented?
- Built-in validation and the option to pretty-print or minify.
- Where processing happens: whether the conversion runs in your browser or on a server cannot be determined from how a site looks or what its marketing says. Check the tool's documented privacy and retention terms, or use a local tool or script, before converting personal, financial or confidential data.
Gaps in this review
This article draws on the defined behavior of the JSON format and on widely documented conversion pitfalls. It contains no hands-on tests of named converters, no performance or accuracy measurements, and no verified compatibility results for particular apps or assistive technologies. Before relying on any specific tool or destination, test it with a sample of your own data that includes the awkward cases: leading zeros, large IDs, empty fields, non-English text and emoji.