freesozoFree tools, no sign-up (home)
All tools
Language: English
Tool number 23

JSON, CSV and YAML Converter and Formatter

Paste JSON, CSV or YAML. The tool works out which it is and converts it to the format you pick. If something is wrong, it tells you in plain words what's wrong and on which line.

Read as

Where the mistake is

Numbers that start with 0 (such as phone numbers) and numbers with 16 or more digits stay as text.

Result (JSON)

Write as
Indent
Separator

        The data you paste is processed only on this page. It isn't sent anywhere or saved in your browser (it's gone when you close the page). Only settings such as the formats and the indent are saved.

        What to do next

        What you can convert

        ReadWriteGood for
        JSONJSONFormatting (indenting), minifying (one line), sorting keys, switching between \uXXXX and the characters themselves
        JSON, YAMLCSVLooking at API responses or settings in a spreadsheet
        CSVJSON, YAMLUsing a spreadsheet table in a program or a config file
        JSONYAMLRewriting a config file as YAML
        YAMLJSONChecking what values a YAML config is actually read as
        YAMLYAMLTidying the indentation (comments are kept)
        JSON LinesJSON, CSVTurning logs with one record per line into an array or a table

        JSON Lines is a format with one JSON value per line. When several lines of JSON starting with { or [ follow one another, the tool reads them as JSON Lines automatically.

        JSON mistakes, and how they're read

        JSON is a strict format. It has no comments. You can't put a , after the last item. Text goes in " quotes. true, false and null are written in lowercase. Copy settings from a program's config file or data from another language, and this is where you get caught out.

        This tool fixes mistakes whose meaning is clear as it reads them. Everything it fixed is listed with its line number, and the result is valid JSON.

        Written asWhat breaks the rulesHow this tool reads it
        {"a": 1, "b": 2,}A , after the last itemDrops the ,
        {"a": 1 // note }Comments (// and /* */)Drops the comments
        {'a': 'b'}Text in ' quotesPuts it in " quotes
        {a: 1}A key without " quotesAdds the " quotes
        {"a": True, "b": None}True, False and None (as written in Python)Turns them into true, false and null
        {"a": undefined, "b": NaN}undefined, NaN and InfinityTurns them into null
        [1 2 3]Missing , between itemsAdds the ,
        [+1, 012, .5, 0x1F]A leading + or 0, a number starting with a decimal point, hexadecimalTurns them into 1, 12, 0.5 and 31
        {"a":1,"b":2}Full-width colons, commas, braces and brackets, or full-width spaces (common with Japanese input)Reads them as the normal symbols
        {“a”: “b”}Curly quotes (“ ”)Reads them as "
        "C:\Users"A backslash JSON doesn't allow (like \U)Reads the \ as a plain backslash

        To check without fixing anything, tick "Read JSON strictly". It stops at the first mistake and shows where it is. Use it to check that JSON you're handing to another program follows the rules.

        Mistakes it can't fix

        With mistakes like an unclosed bracket or a missing value, there's no telling what the right fix is. In those cases, the tool stops and shows where and why.

        Written asWhat it says
        {"a": [1, 2}A [ is closed with }
        {"a": 1A { is never closed
        {"a": "abc}A piece of text is never closed
        {"a": }There is a } where a value should be
        {"a" 1}There is no : after the key
        {"a": hello}hello can't be read as a value
        {"day": 2026-11-28}2026-11-28 can't be read as a number

        In JSON, dates and times are written as text ("2026-11-28"). Leave out the " and the tool tries to read them as numbers, and stops.

        When the same key appears twice

        The JSON rules say the keys inside one { } should be unique. Repeated keys still parse, but what happens then depends on the tool reading them. This tool uses the later value and tells you the key is repeated.

        Numbers stay exactly as written

        This tool doesn't recalculate numbers. 1.10 stays 1.10, and 1e5 stays 1e5.

        This matters most for long integers. The largest integer JavaScript can handle exactly is 9007199254740991 (2 to the power of 53, minus 1). Read a bigger ID the usual way, and it quietly becomes a different number: 12345678901234567890, for example, becomes 12345678901234567000. This tool keeps numbers as written, so they don't change.

        The program that receives the converted JSON can still run into the same problem, though. It's safest to put long ID numbers in " quotes as text from the start.

        How CSV is read

        • Separator: commas, tabs, semicolons and pipes are detected automatically. Cells copied from Excel or Google Sheets paste as tab-separated text, and that reads as it is.
        • Fields in " quotes: a field that contains a comma or a line break is put in " quotes, and a " inside a field is doubled as "". The tool reads this way, and when it writes, it quotes only the fields that need it.
        • Headings: with the first row as headings, you get an array of "heading: value" objects. Untick it to get an array per row.
        • Types: fields that look like numbers become numbers, and true and false become true/false values. Numbers that start with 0 (090…, 012) and numbers with 16 or more digits stay as text, so phone numbers, postcodes and member numbers don't turn into numbers and lose their leading 0.
        • Character encoding: drop in a file, and it's read as UTF-8, Shift_JIS, EUC-JP or UTF-16, whichever it is. CSV saved from Japanese Excel (Shift_JIS) reads as it is too.

        CSV for Excel

        Open a UTF-8 CSV in Excel as it is, and characters outside English can come out garbled. A UTF-8 file with a marker called a BOM at the start opens normally. "Save CSV for Excel" adds the BOM and ends lines with CRLF.

        Excel reads anything that looks like a number as a number. Leading zeros disappear, and digits after the 15th become 0 (Excel keeps 15 significant digits). If you have a column of phone numbers or long ID numbers, don't open the file directly. On Excel's Data tab, choose From Text/CSV, press Edit, select the column and set Home > Transform > Data Type to Text.

        Shapes that can become a table, and ones that can't

        CSV is just rows and columns. JSON or YAML can become CSV when it has one of these shapes.

        Original shapeAs CSV
        An array of { } objectsThe keys become the headings, and each { } becomes a row. Every key is collected, in the order it first appears
        An array of [ ] arraysEach [ ] becomes a row (no headings)
        An array of plain valuesA one-column table
        A single { }Headings and a single row
        An array that mixes { } with other valuesCan't become a table

        Nested { } objects are spread into columns with the keys joined by dots, like "a.b". Nested arrays go into a single cell as one line of JSON. Press "Table" at the top right to see what the table will look like before you save.

        Things to watch in YAML

        yes, no, on and off depend on the tool reading them

        YAML has two versions, 1.1 and 1.2, and they read unquoted words differently.

        Written valueYAML 1.1YAML 1.2
        yes, no, on, off, y, nTrue/false valuesText
        true, falseTrue/false valuesTrue/false values
        012Read as octal: the number 10The number 12

        For example, the country code NO (Norway) written without quotes becomes false in tools that follow the 1.1 rules. Which rules a tool follows varies from tool to tool. The documentation for Python's PyYAML shows on and off being read as True and False.

        • Reading: this tool reads YAML by the 1.2 rules. Convert your YAML to JSON to see what values it has under 1.2.
        • Writing: text such as no, on, 012, 1:30 and 2026-11-28 is written in " quotes, so it stays the same text under either set of rules.

        Other things

        • Indent with spaces. YAML indentation can't use tabs.
        • Comments: tidying YAML into YAML keeps the comments. JSON and CSV have nowhere to put comments, so they're lost when you convert.
        • A space before #: to put a comment after a value, you need a space before the #.
        • Aliases (& and *) and merge keys (<<): they're expanded when read, so converting to another format gives the expanded values.
        • Several documents separated by ---: they're read into a single array.
        • Old browsers: reading and writing YAML uses a separate part that's loaded only when needed. It may not work in old browsers. If so, a notice appears on screen (JSON and CSV still work).

        Tips

        • Turning escapes like \u00e9 back into readable characters: paste the JSON and convert it to JSON. \uXXXX escapes come out as the characters themselves. To do the opposite, tick "Write non-ASCII characters as \uXXXX".
        • Turning a Python dict or a JavaScript object into JSON: paste something like {'name': 'x', 'ok': True, 'memo': None}, and the tool changes ' to " and True and None to true and null, giving you JSON. It can't read round brackets (tuples) or function calls.
        • Comparing two JSON files: format both with "Sort keys alphabetically" ticked. Differences in key order disappear and only differences in content remain. Then compare them with the Text Diff and Character Counter.
        • Going from CSV to JSON to YAML: press "Use the result as input" to put the result in the box on the left.
        • A one-column CSV isn't read as CSV: with no separator, it can't be detected. Choose CSV under "Read as".
        • Large data: up to 5 million characters can be read. The screen shows only the first 300,000 characters and the first 200 rows of the table. Copying and saving include everything.

        FAQ

        Is the data I paste sent anywhere?
        No. Reading and converting both happen only in the browser you have this page open in, and nothing is saved in your browser either. This site is set up so that its pages can't send anything out.
        Does formatting change how numbers are written, or the order of keys?
        No. Numbers come out exactly as written, and keys stay in their original order (they're sorted only if you tick "Sort keys alphabetically").
        Can it read JSON with comments (JSONC) or JSON5?
        It reads comments, trailing commas, text in ' quotes and keys without quotes. What comes out is valid JSON with no comments. Not every JSON5 feature is supported.
        It says "Where it breaks the JSON rules". Can I still use the result?
        Yes. The result is the fixed, valid JSON. The original data still breaks the rules, though, so if you can fix whatever produces it, use the list to do so.
        How deep can the nesting go?
        Up to 1,000 levels.
        Can it convert to XML or TOML?
        No. This page handles only JSON, CSV and YAML (and JSON Lines).

        Sources

        All checked on November 28, 2026. YAML is read and written with "yaml", a published open-source package (version 2.9.1, ISC license).

        More tools