Convert CSV to JSON without uploading the file
CSV and JSON convert both ways locally. The conversion is where records quietly change shape, because CSV has no type system and JSON does, so identifiers, dates and phone numbers need attention.
At a glance
- Tools
- /tools/csv-to-json and /tools/json-to-csv
- Direction
- Both ways
- CSV type system
- None. Every field is text
- JSON type system
- Strings, numbers, booleans, null
- Highest risk fields
- Identifiers with leading zeros, dates, currency, phone numbers
- Structure
- Nested JSON has to be flattened before it can be a CSV
In detail
A conversion like this sits between an export and an import: a product catalogue moving between systems, a member list going into a new platform, a batch of transactions being reconciled. A bad conversion becomes a bad import, and a bad import becomes a support queue full of people whose records are now wrong. Keeping the file off a third party's machine is the easy part; getting the types right is the work.
Types are where data is lost silently. A value like 007312 is an identifier, and the moment it is treated as a number the leading zeros are gone for good. The same applies to postcodes, account numbers and phone numbers with a country prefix. Decide what each column actually is before you convert, and quote anything that is an identifier rather than a quantity.
Dates are worse than numbers, because a CSV date carries no format and no timezone: 03/04 is two different days depending on who wrote it. Fix a single unambiguous format on the way in and check a row you know. Going the other direction, remember that JSON nests and CSV does not, so nested objects and arrays have to be flattened into columns before a spreadsheet can hold them.
Do the conversion with the network disconnected the first time. It works, and once you have seen a large export convert offline you have the answer for the next time somebody asks whether the customer list went anywhere. A hosted converter that is still spinning when you pull the network has already told you where the file went.
Things that catch people out
- Leading zeros on postcodes, account numbers and phone numbers disappear the moment a field is treated as a number.
- An empty CSV cell and a JSON null are not the same thing, and importers disagree about which is which.
- Check the row count in both directions. Quoted fields containing the delimiter or a line break are where counts drift.
Try it: Hash Generator
The file hasher is on every page here because it takes any file at all and proves the point: disconnect from the network, drop a file in, and it still returns a checksum you can compare against a published one.
Hash Generator
LOCAL · Browser-OnlyGenerate MD5, SHA-1, SHA-256, SHA-384, SHA-512, SHA3-256, SHA3-512, Keccak-256, CRC32, and HMAC hashes from text or files
MD5 is cryptographically broken and should not be used for security purposes. Use SHA-256 or SHA-512 instead.
Related Working without uploading
All working without uploading →Open and filter a CSV without uploading it
Sort, filter and hide columns across up to 100,000 rows locally. A customer export is personal data, and opening it should not be a transfer.
Format and validate JSON without uploading it
Tidy and check JSON in your browser. The JSON people paste into a formatter is usually a live API response full of real records.
Convert YAML to JSON without uploading the file
Convert YAML and JSON both ways in your browser. Infrastructure YAML is configuration, and configuration is where credentials sit.
Convert XML to JSON without uploading the document
Convert XML in your browser. Why attributes, namespaces and repeated elements have no single correct JSON equivalent to fall back on.
Compare two files without uploading either of them
Diff two versions of a document or a config in your browser. A hosted comparison receives both files, which doubles the exposure.
View a file as a hex dump without uploading it
Inspect any file's raw bytes in your browser. If you cannot identify a file, uploading it to find out is the wrong first move.
Tools for this
- CSV to JSON Converter Free online CSV to JSON converter - convert CSV data to JSON format with delimiter options and preview
- JSON to CSV Converter Free online JSON to CSV converter - convert JSON arrays to CSV format for spreadsheets and databases
- CSV Viewer Free online CSV viewer - view, sort, and filter CSV data in an interactive table format