Two tools for two stages of working with data
Structured text means data written as plain text but organized by rules, so that software can read it. Two formats dominate everyday work: CSV for tables and JSON for nested records. The Csv To Json Converter moves from the first to the second, and the Json Validator Formatter checks and lays out the second. A typical sequence is to export a spreadsheet as CSV, convert it to JSON, and then validate the result before sending it to an API or storing it. Each step catches a different kind of problem, and doing them in order saves debugging time later.
What CSV actually specifies
CSV looks simple and is not fully standardized. RFC 4180 documents the common conventions: one record per line, fields separated by commas, an optional header line, and double quotes around any field that contains a comma, a quote or a line break. A quote inside a quoted field is written as two quotes. Real files depart from this. Some use semicolons because the comma is the decimal separator in many European locales, some use tabs, and some spreadsheet exports add a byte order mark at the start. If the converted output has too few or too many columns, the delimiter is the first thing to check.
How a table becomes JSON
A table has rows and columns, while JSON has objects with named keys. With the option that the first row contains headers, the converter takes that row as the keys and turns each later row into an object. A CSV with the header name,age and a row Ana,31 becomes an object with a name key and an age key. Cells are kept as text, so 31 arrives as the string "31" and 007 keeps its leading zeros. That protects identifiers like ZIP codes and phone numbers, and it means you cast real quantities to numbers in your own code. Without the header option, the rows come back as plain lists of cells.
The JSON rules that trip people up
JSON, specified in RFC 8259, is stricter than JavaScript object syntax. Keys and strings must use double quotes, single quotes are invalid, and comments are not allowed. A trailing comma after the last item is an error, and so is a missing comma between items. Values may be strings, numbers, true, false, null, objects or arrays. Numbers cannot have a leading plus sign, hexadecimal notation or extra leading zeros, and NaN and Infinity do not exist. When a parser rejects a document, the true mistake is often just before the point where it gave up.
Why formatting matters even when the data is valid
Whitespace has no meaning in JSON outside strings, so a minified document and an indented one carry identical data. Indented output makes nesting visible, which helps in code review, in diffs and when hunting a misplaced bracket. Minified output saves bytes for network transfer. A formatter lets you switch between the two without changing content. The Json Validator Formatter checks syntax and re-indents the original tokens, keeping key order, number spelling and escapes. It does not reject duplicate keys, which different consumers may read differently, and it does not validate a schema. Key order in an object is not guaranteed to carry meaning, so two documents with keys in a different order are usually equivalent to a parser, even if a text comparison flags them as different.
Character encoding and special characters
JSON text is normally encoded as UTF-8, and a CSV file may use another encoding, such as Windows-1252 for files produced by older spreadsheet exports. If names with accents turn into sequences like é, the file was read with the wrong encoding. Inside JSON strings, a quote must be written as \", a backslash as \\, and control characters such as a newline as \n. Non-ASCII characters may appear directly or as \u escapes. Both are valid, and both parse to the same text.
Numbers, dates and precision
JSON has a single number type and no date type. Dates travel as strings, and ISO 8601 (2026-03-15 or 2026-03-15T09:30:00Z) is the safest choice because it sorts correctly as text. Large whole numbers beyond 2^53, about 9.007 × 10^15, lose exactness in languages that store numbers as double-precision floats, so long identifiers are better written as strings. A spreadsheet may also have turned a long number into scientific notation before export. Check that account numbers and barcodes survived the trip intact. Time zones deserve the same care. A bare 2026-03-15T09:30:00 has no zone, and software may read it as local time or UTC, shifting an event by hours. Adding Z or an offset such as +01:00 removes the guess. Currency amounts are better kept as strings or as whole minor units, such as 1999 cents, to avoid floating-point surprises like 0.1 + 0.2 giving 0.30000000000000004.
A small worked conversion
Take a three-line CSV file. The header is sku,name,price and the rows are A100,"Bolt, M6",0.25 and B200,Nut,0.1. The comma inside the quoted name stays in the field, so the first object has sku A100, name Bolt, M6 and price 0.25. The converter keeps every cell as a string, so the price arrives as "0.25" in quotes, and you cast it afterward if you need a number. The finished array holds two objects, matching the two data rows. Pasting it into the Json Validator Formatter then confirms the syntax and shows the indented layout, so you can see at a glance that each object carries the same three keys.
Missing values, empty cells and repeated headers
An empty CSV cell can mean an unknown value, an empty string or a value that does not apply, and the conversion cannot tell which. The result is typically an empty string, and your application may want null instead. Duplicate header names would create duplicate keys, so the converter rejects them by default, and rows with the wrong number of cells are rejected too. Blank lines at the end of a file can produce an extra empty row. Cleaning these before conversion gives a more predictable result, and a quick look at the first and last records of the output usually shows whether the structure came out as intended. Related to this, a validator confirms that text follows JSON syntax. It does not know whether a field is required, whether an age is plausible, or whether the structure matches what an API expects. That is the role of a schema or application code. Treat a successful parse as a minimum check. Before loading a converted file into a system, spot-check a few records against the original table and confirm the record count matches the number of data rows.
Frequently asked questions
- Why are my CSV columns shifted after conversion?
- Usually an unquoted comma inside a field changed where the fields split. The converter expects commas as separators and rejects rows with an uneven number of cells, so check quoting and delimiters first.
- Can JSON contain comments?
- No. The JSON specification has no comment syntax, so a document with comments will fail validation.
- Does the converter turn numbers in the CSV into JSON numbers?
- No. It keeps every cell as a string, which protects leading zeros and long identifiers. Cast real quantities to numbers in your own code.
- Does a valid JSON result mean the conversion is correct?
- No. It means the syntax is valid. Compare the record count and a few values with the original table to confirm the content.