Skip to main content
Preparing workspace

CSV Converter

Open a local CSV or TSV file or paste delimited text. Convert it to JSON, HTML, XML, SQL or Python, then preview, copy or download the result.

Still loading. If the tool doesn’t appear, reload this page.

About this tool

CSV Converter

Convert CSV into JSON, HTML, XML, SQL inserts, or Python dictionaries.

The CSV Converter rewrites a local CSV or TSV file or pasted delimited text as JSON, an HTML table, XML, SQL INSERT statements or a Python list of dictionaries. It reads quoted fields containing delimiters, CRLF line breaks and doubled quotes. It detects common text encodings and delimiters when opening a file. Conversion and download run in your browser. Each output format applies its own escaping, including HTML entities, XML character data, doubled single quotes in SQL and backslashes in Python string literals.

How to use CSV Converter

  1. Paste your CSV into the 'CSV input' box on the CSV Converter page, typing over the sample rows that load there — the 'Reset' button brings the sample and the default settings back.

  2. Pick your target from the 'Convert to' dropdown (JSON, HTML table, XML, SQL INSERT or Python dicts) and match the 'Delimiter' list, 'First row is a header' and 'Detect numbers, booleans and blanks' to your data; choosing SQL INSERT reveals a 'SQL table name' field.

  3. The Output panel updates as you type — check the 'Parsed preview' of the first five rows, then press 'Copy output' to copy the converted result.

Why use CSV Converter

  • RFC 4180 parsing, not a naive split

    Quoted commas, embedded CRLF line breaks and doubled quotes are resolved by a character-level scanner, so real spreadsheet exports survive the conversion intact.

  • Five output formats

    Switch among JSON, HTML, XML, SQL and Python using the same source data. Download the output with the extension for that format.

  • Escaping matched to each target

    HTML entities, XML character data, ANSI single-quote doubling in SQL and \n / \" escapes inside Python literals are each applied by the writer for that format.

  • Local file conversion

    Read compatible files on your device, check their first rows in the preview and save the conversion from the browser.

Common use cases

  • Turning a spreadsheet export into a typed JSON fixture for tests or a front-end mock, with numbers, booleans and blank cells converted instead of left as strings
  • Seeding a database table from a supplier price list or contact export by generating INSERT statements against a table name you set yourself
  • Converting a semicolon- or tab-separated export out of a European Excel install into an HTML table you can paste straight into a page or CMS block

Frequently asked questions

Is this CSV converter free?

Yes — free, with no account and no trial limit. The only cap is a safety limit of 20,000 records or roughly 4 MB of pasted text per conversion, which exists so a huge paste can't lock up the browser tab.

Link to answer
Can I open a local CSV file and download the conversion?

Yes. Select Open CSV or TSV file, check the detected delimiter and choose an output format. Download output saves the result as a JSON, HTML, XML, SQL or Python file. You can also paste delimited text and use Copy output.

Link to answer
How do I convert CSV to JSON with this tool?

Paste the CSV and leave the format on JSON. You get a pretty-printed array of objects, indented two spaces, one object per data row keyed by your header names. With type detection on, 42 becomes a number, true/yes and false/no become booleans, and an empty cell becomes null.

Link to answer
How do I put a comma inside a CSV field?

Wrap the whole field in double quotes: "Sharma, Priya" is one field, not two. RFC 4180 also allows a line break inside a quoted field, and a literal double quote is written twice — "Lee ""Jay"" Min" parses as Lee "Jay" Min. All three rules are implemented here.

Link to answer
Does it handle semicolon or tab-separated files?

Yes — pick comma, semicolon, tab or pipe from the delimiter list. Semicolon files are what Excel writes in locales that use a comma as the decimal separator, such as Germany and France, so a European export that looks mangled usually just needs the semicolon setting.

Link to answer
Are the generated SQL INSERT statements safe to run?

They escape single quotes by doubling them, which is the ANSI SQL rule, and an empty cell becomes NULL rather than an empty string. Review them before running against a live database: the table name comes from the field you type, column names are derived from your header row and lower-cased to snake_case, and types are inferred from the data rather than read from your schema.

Link to answer
Will type detection destroy my zip codes and IDs?

Leading zeros are safe — the number pattern rejects them, so 01234 stays the string "01234". A plain digit string with no leading zero, such as a 10-digit phone number, does become a number, so untick "Detect numbers, booleans and blanks" when every cell must stay text.

Link to answer
What happens if some rows have more columns than the header?

Short rows are padded with empty values so every record has the same width, and the count is reported as "Rows with a different column count" so you can spot a broken export. Duplicate header names are de-duplicated (name, name_2), and a blank header becomes column_1, column_2 and so on.

Link to answer

Embed this tool on your site

Add the CSV Converter widget to your blog or website — free, responsive, no signup. Just keep the “Widget by AltFTool” credit link visible.

<iframe src="https://www.altftool.com/embed/widget/csv-converter"
  title="CSV Converter — free AltFTool widget"
  width="100%" height="640" style="border:0;border-radius:12px;overflow:hidden"
  loading="lazy" referrerpolicy="no-referrer-when-downgrade" allow="clipboard-write"></iframe>
<p style="font-size:12px;margin:4px 0 0">Widget by <a href="https://www.altftool.com/tools/all/csv-converter?utm_source=embed&utm_medium=widget" rel="nofollow">AltFTool — free online tools</a></p>

Browse all embeddable widgets →