Skip to content

Open a large JSON file (100 MB) offline on Windows: check it, find the error, read it

Measured on 5.6 million lines: json.tool finds a missing comma in a second; PowerShell 5.1 needs 2 GB and gives a character position; JSON Toolkit adds a CSV copy.

We make JSON Toolkit, the app this guide uses. The free methods come first; every step shown in JSON Toolkit was checked in the app itself, and the screenshots come from the real app with invented sample data.

Short answer

Check the whole file first, then read only the part you need. On a 90.8 MB JSON file of 5.6 million lines, Python's json.tool named the line and column of a missing comma in about a second, and a short Python command printed the lines around it in a quarter of a second. Windows PowerShell 5.1 read the valid file in 15.8 seconds using about 2 GB of memory, but on the broken copy it gave only a character position and put the whole file in its error message. JSON Toolkit checks the whole file, shows its first 50,000 lines, gives the line of an error even beyond them, and saves a CSV copy.

The test file

We made an invented export: a year of orders of an invented shop, 220,000 orders in one JSON list, indented with two spaces. orders-2026.json is 95,210,004 bytes (90.8 MB as Windows counts) and 5,605,962 lines. A copy, "orders-2026 (copy from the server).json", is one byte shorter: the comma after the closing brace of an order on line 4,204,654 is left out, so the error is reported at line 4,204,655, where the next order starts. There are no real names, emails or addresses in either file.

Method 1 (free): Python

Python's json module includes json.tool, which reads a whole file and stops at the first error with its line and column. We ran it on 30 November 2026 (Python 3.11.9, Windows 11), from the folder that holds the files:

py -3 -m json.tool "orders-2026 (copy from the server).json"
Expecting ',' delimiter: line 4204655 column 3 (char 71411029)

That took 1.1 seconds, with exit code 1. On the valid file, json.tool prints all of it formatted, so throw the output away: with > NUL at the end of the command (> $null in PowerShell) it took 12.4 seconds and ended with exit code 0. To read the lines around the error without loading the file, this command prints lines 4,204,652 to 4,204,656. Run it in PowerShell: in Command Prompt, the line breaks inside the quotes end the command.

py -3 -c "import itertools, sys
with open(sys.argv[1], encoding='utf-8') as f:
    for n, line in itertools.islice(enumerate(f, 1), 4204651, 4204656):
        print(n, line, end='')" "orders-2026 (copy from the server).json"
4204652       }
4204653     ]
4204654   }
4204655   {
4204656     "id": 265001,

It took 0.25 seconds. One order ends at line 4,204,654 and the next starts at line 4,204,655 with no comma between them: add it after the closing brace, in an editor or a copy, and run json.tool again.

Method 2 (free): Windows PowerShell 5.1

Windows PowerShell 5.1, built into Windows 10 and 11, reads JSON with ConvertFrom-Json. On the valid file:

$orders = Get-Content -Raw orders-2026.json | ConvertFrom-Json
$orders.Count
220000

It took 15.8 seconds, and the PowerShell process peaked at 1,949 MB of memory for a 90.8 MB file. On the broken copy, we added -ErrorAction Stop to ConvertFrom-Json and caught the error instead of letting it print. It stopped after 3.1 seconds with an error in the system's language (French on our test PC): an invalid array, a comma expected, at character 71411030. The message then contained the whole text of the file: 95,210,055 characters, far too much to print in a console window. PowerShell gives no line number. With the line from json.tool (4,204,655), Get-Content can read up to it:

Get-Content "orders-2026 (copy from the server).json" -TotalCount 4204656 | Select-Object -Last 5
      }
    ]
  }
  {
    "id": 265001,

It printed the same five lines as Python, in 15.6 seconds instead of 0.25.

Other free tools, not run here

  • jq, a command-line JSON processor, prints JSON formatted by default; its --stream mode outputs paths and values one at a time, which its manual says is useful for very large inputs.
  • Firefox opens JSON files in its built-in JSON viewer.

We did not run either on the test file. Before pasting a large export into a website instead, read our guide on whether it is safe to paste JSON into an online formatter.

Method 3: check, read and convert it with JSON Toolkit

JSON Toolkit is our Windows app for structured data: it formats, minifies and validates JSON, checks files against a JSON Schema with clear error locations, compares two files by meaning and converts between JSON, YAML and CSV, offline, with files up to 100 MB each. The screenshots below come from version 1.0.0 (evaluation build) with the two invented files.

  1. Add the files. Both were checked whole. The valid file: "OK", "JSON: a list of 220,000 items". The broken copy: "1 error", line 4204655, column 3, "a comma is missing between two values", with the note "(line 4,204,655 is after the lines shown)".
  2. Read the start. The viewer says "The first 50,000 lines are shown; the checks cover the whole file."
  3. Save a CSV copy. With the valid file selected, CSV and For Excel, the copy preview listed the changes before saving: CSV rows from 220,000 records, nested objects as a.b columns, the 220,000 lists of order lines written as JSON text in one cell, and UTF-8 with a byte order mark so that Excel reads the text correctly. Saving wrote 1 copy into the folder we chose.
JSON Toolkit with two files: the copy from the server with 1 error at line 4204655, column 3, a comma missing between two values, after the lines shown; the valid file OK with 220,000 items.
The error's line and column, even past the part shown. JSON Toolkit 1.0.0 (evaluation build), tested 30 November 2026, invented sample data.
The valid orders file selected, with no problems, the start of the file in the viewer and the note that the first 50,000 lines are shown and the checks cover the whole file.
The viewer shows the start; the check covers the whole file. JSON Toolkit 1.0.0 (evaluation build), tested 30 November 2026, invented sample data.
The CSV copy preview of the orders, with columns id, placed, status, customer.id, customer.country, currency, total and lines, and the list of changes the conversion makes.
The conversion's changes are listed before saving. JSON Toolkit 1.0.0 (evaluation build), tested 30 November 2026, invented sample data.
The same preview after saving, with the status line saying 1 copy was written into the chosen folder.
The CSV copy saved as a new file in the chosen folder. JSON Toolkit 1.0.0 (evaluation build), tested 30 November 2026, invented sample data.

We read the saved orders-2026.csv back: 40,019,160 bytes, UTF-8 with a byte order mark, the header id, placed, status, customer.id, customer.country, currency, total, lines, and 220,000 rows of data. Both JSON files had the same SHA-256 after the run as before it. To compare two exports, see our guide to comparing two JSON files by meaning.

How to Format, Validate and Compare JSON Offline on Windows1:04Watch on YouTubeNothing loads from YouTube until you press play. The player then loads from youtube-nocookie.com, YouTube's privacy-enhanced mode, and connects to Google's servers. Privacy

Limitations

  • json.tool and ConvertFrom-Json stop at the first error. Windows PowerShell 5.1 gives a character position, not a line, and on our file its error message held the whole 95 MB of text; it also needed about 2 GB of memory.
  • Line numbers depend on the file's formatting: a file on one line has a single line.
  • Windows PowerShell 5.1 reads a UTF-8 file without a byte order mark as the system's code page unless you add -Encoding UTF8 to Get-Content, which garbles accented text. Our test file was plain ASCII, so it made no difference here.
  • JSON Toolkit takes files up to 100 MB each and shows the first 50,000 lines; its checks cover the whole file. Its planned requirements: Windows 10 (22H2) or 11, 64-bit.
  • We tested one invented 90.8 MB file. We did not test files above 100 MB, PowerShell 7, jq or Firefox's viewer.

References