UltKit

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

Output

Files are processed on our servers and deleted after 30 minutes.

How to use this tool

  1. 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. 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. 3

    Convert to JSON

    Press Convert to JSON and download the file, indented for reading or compact with Pretty print off.

Answer

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

What the JSON looks like

Input lines sku|color|stock and TS-104|navy|38, as JSON
[
  {
    "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
–
TXT converter

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
JSON converter

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.