Nekonote Toolbox logo

Nekonote Toolbox

Free browser-based tools for developers and IT admins.

日本語

CSV to JSON Converter

About this tool

Turn a CSV or TSV table into JSON for an API, a config file, a test fixture or a database import. You choose the shape: an array of objects keyed by the header row, an array of arrays, an object keyed by one column, or JSON Lines for streaming and bulk loading.

Everything runs in your browser. Your data is never sent to a server.

How it works

  • The input is read as CSV (RFC 4180): a value in double quotes may contain the separator, a doubled "" for a quote, and line breaks. Empty lines are skipped, and a byte order mark at the start is ignored.
  • Convert numbers, true / false and null: an unquoted value becomes a JSON number only if it is a plain decimal such as 42, -3.5 or 1e6. Values with leading zeros (007), a plus sign, hex, or more than 15 significant digits (long IDs) stay text, so nothing is rounded or loses its zeros. true, false and null in any capitalization become JSON values. A value in quotes always stays text.
  • An empty unquoted cell becomes "" or null, as you choose. A quoted empty value "" is always an empty string.
  • Headers: an empty header becomes column_N (N is its position), and a repeated header gets _2, _3 and so on, so no data is lost. Without a header row the keys are column_1, column_2...
  • A row with fewer values than the header is filled with empty values. A row with more values keeps the extra ones under column_N keys. The summary above the result tells you how many rows were adjusted.
  • Nest keys that contain dots turns a header such as address.city into a nested object. A header that cannot be nested without clashing with another one (for example both a and a.b) stays a flat key.
  • Keys keep the order of the columns in your file, including keys that look like numbers (2023), which a plain JavaScript object would move to the front.
  • Object keyed by a column uses the text of the key column as the key and the other columns as the value. If a key repeats, the later row replaces the earlier one, and the summary says so.

FAQ

Q. Why is my ZIP code or ID still text?

A. Values with leading zeros or more than 15 digits are kept as text on purpose, because a JSON number would drop the zeros or round the digits. Untick Convert numbers if you want every value as text.

Q. How do I get dates as dates?

A. JSON has no date type, so dates stay text. Use ISO 8601 (2025-01-31) in your CSV to make them easy to parse later.

Q. Can I convert a very large file?

A. Files up to 20 MB are accepted. The whole result is built in memory, so very large files are better split first, for example with the CSV Splitter.