TXT to JSON Converter
Give structure to a plain text file. When each line holds the same fields separated by tabs, pipes, commas or spaces, the converter turns the lines into JSON records that code can read without a custom parser.
Data Converter
or drop CSV, TSV, TXT … files here ·
Max 95 MB per file· Up to 20 files· Deleted after 30 minutes
Files are processed on our servers and deleted after 30 minutes.
Character that separates columns in CSV and text files, for both reading and writing. Auto detects it from the input and writes commas.
UTF-8 works for every language. Choose UTF-8 with BOM if Excel on Windows shows garbled accents or Asian characters when opening the CSV.
Excel, ODS and Numbers input: convert the first sheet only, or every sheet (one CSV per sheet in a ZIP, or one JSON key per sheet).
Name of the sheet tab in the new spreadsheet, up to 31 characters.
Array of objects uses column names as keys for every row; array of arrays is more compact and keeps the header as the first array.
Name of the outer element that wraps all rows; each row becomes a <row> inside it.
Used in CREATE TABLE and INSERT statements. Letters, digits and underscores only.
Quoting and column types differ slightly between databases; pick the one you will import into.
Rewrite date cells in one format. ISO (2026-10-18) is safest for databases and code; keep leaves them as they appear in the source.
How to use this tool
- 1
Upload the text file
Add a .txt export, a tab-separated dump or a list with one entry per line. Up to 20 files, 95 MB each.
- 2
Tell it how the lines are split
Delimiter starts at Auto detect. Under Advanced settings, pick Tab, Pipe or Space when you know it, set Text encoding for older files, and turn off First row is header if line 1 is data.
- 3
Convert to JSON
Press Convert to JSON and download the file, indented for reading or compact with Pretty print off.
How do I convert a TXT file to JSON?
Upload the .txt file, keep Delimiter on Auto detect and First row is header on, then press Convert to JSON. Each line becomes one object, and the words in line 1 become the keys.
Which text files convert cleanly to JSON
A .txt extension says only that a file holds characters; it promises nothing about structure. The files that convert well are the ones that are secretly tables. Copying cells out of Excel or Google Sheets puts tab-separated text on the clipboard, so pasting into Notepad and saving gives you exactly that kind of file. Banks, payroll systems and older ERPs export pipe-delimited .txt reports, and scientific instruments often write space- or tab-separated readings.
Prose does not convert, and neither does a document whose line layout changes halfway through. If the file is really comma-separated and you want a spreadsheet rather than code, TXT to CSV is the shorter path. Notepad has saved new files as UTF-8 by default since Windows 10 version 1903, so recent files usually need no encoding change; files from older machines often do.
Convert text to JSON by separator type
The most forgiving case. Tabs rarely appear inside values, so names with commas and addresses with spaces stay in one field.
- Clipboard copies from spreadsheets
- Many database client exports
Common in financial and mainframe exports precisely because | almost never occurs in real data.
- Bank and payroll reports
- Line-oriented application logs
A CSV saved with a .txt extension. Values containing commas must be wrapped in double quotes, as RFC 4180 describes, or columns shift.
- Exports renamed for email filters
- Older contact lists
Works only when no value contains a space. Single words, codes and numbers are fine; full names are not.
- Instrument readings
- Word and ID lists
What the JSON looks like
[
{
"sku": "TS-104",
"color": "navy",
"stock": 38
}
]- separators plus Auto detect
- 5
- source text encodings
- 8
- text files per batch
- 20
- before uploads are deleted
- 30 min
Plain text and JSON compared
TXT
Plain text
A TXT file contains only plain characters with no formatting, fonts, images or layout. Modern text files are usually encoded in UTF-8, which covers every language, though older files may use other encodings and show garbled characters. Plain text is tiny, never becomes obsolete and opens on every device, from phones to servers. It cannot hold bold text, tables or pictures, so structure must be expressed with spacing or simple markup.
- Compression
- –
- Transparency
- –
- Animation
- –
- Introduced
- –
JSON
JavaScript Object Notation
JSON is a lightweight text format for structured data, popularised by Douglas Crockford in the early 2000s and standardised as RFC 8259 and ECMA-404. It represents objects, arrays, strings, numbers, booleans and null with simple, readable syntax. It is the default format for web APIs, configuration files and data exchange between apps in almost every programming language. It has no comments, dates or schemas built in, and large nested files are hard to read without a viewer.
- Compression
- –
- Transparency
- –
- Animation
- –
- Introduced
- 2001 · Douglas Crockford
TXT turns into JSON when text exported from an older program or copied out of a report has to enter modern code, an API body or a NoSQL import, and nobody wants to hand-write a parser for one file.
TXT to JSON FAQ
My text file is one item per line. Can it become a JSON array?
Yes. With a header line such as name on top, every following line becomes an object like {"name": "Lisbon"}. Without a header, turn off First row is header and choose Array of arrays, which writes each line as a one-item list.
Why did Auto detect split my sentences at every space?
If a file has no tabs, pipes or commas, spaces are the only separator left to find. Set Delimiter to the character your fields really use; free text with spaces inside values needs tabs or pipes between fields to convert cleanly.
Can I convert a log file to JSON?
When every line follows the same pattern, such as timestamp, level and message separated by pipes or tabs, yes. Logs where the message itself contains the separator, or where line layouts vary, need a log parser rather than a table converter.
Which encoding should I pick for a TXT file from an old system?
Files written by Western Windows software before UTF-8 became common are usually Windows-1252; Japanese ones Shift_JIS, Chinese ones GB18030, Korean ones EUC-KR. Pick the source encoding so accented letters are read correctly. The JSON itself is written as UTF-8, the encoding RFC 8259 requires for JSON exchanged between systems.
What about fixed-width text where columns line up with spaces?
The converter splits on a delimiter, not on character positions. If values never contain spaces, the Space setting works. Otherwise open the file in a spreadsheet, split it with its text-to-columns feature, save a workbook and use Excel to JSON.
Do I get JSON or JSON Lines?
Standard JSON: one document with a single top-level array, which any JSON parser loads in one call. JSON Lines puts one record per line and suits streaming, but it is not what this page writes.
- TXT to CSV ConverterConvert delimited .txt files to proper CSV online. Tabs, pipes, semicolons or spaces detected automatically, encodings fixed, values quoted per RFC 4180.
- JSON to TXT ConverterConvert JSON to a plain text file: one record per line, fields split by tabs or any delimiter you pick. Opens in Notepad, Excel and command-line tools.
- Excel to JSON ConverterConvert Excel sheets to JSON online: header row becomes keys, each row an object, dates written as ISO strings. XLSX, XLS, ODS and Numbers accepted.
- CSV to TXT ConverterConvert CSV to a .txt file for upload forms that only take text files, for recipients who should not open Excel, or for any text editor. 20 files at once.
- PDF to JSON ConverterConvert tables inside a PDF to JSON: each row becomes an object keyed by the column headers, ready for a script, an API or a database. Up to 20 PDFs.
- TXT to Excel ConverterConvert a .txt file to an Excel workbook: tab- or comma-separated lines become rows and columns, plain lists become one column. No Text Import Wizard needed.