How to open a JSON file
A JSON file (extension .json) is just plain text, so you can open it in any text editor, in your web browser, or in an online viewer. The quickest way to actually read one, formatted, colored, and foldable, is to paste its contents into the JSON Viewer. It runs entirely in your browser, so the file never leaves your machine. Below are all the ways to open a JSON file, on any device.
Fastest: open it online (formatted)
- Open the JSON Viewer or the JSON Formatter.
- Open the
.jsonfile in any text editor, select all, and copy, or use the tool's Open-file button. - Paste it in. You get a readable, syntax-colored tree you can collapse and search.
Because it is 100% in-browser, this is also the safe way to open a JSON file that contains API keys, tokens, or personal data. Nothing is uploaded, see the note on safety below.
Open a JSON file in a web browser
Every browser can display JSON. Drag the .json file onto an open tab, or press Ctrl+O (Cmd+O on Mac) and select it. Chrome and Firefox show the raw text (Firefox even adds a basic viewer). For folding, searching, and formatting a large file, an online JSON Viewer is far more comfortable.
Open a JSON file in a code editor
Code editors give you syntax colors, folding, and validation:
- VS Code: File › Open, or drag the file in. Right-click › Format Document to pretty-print it.
- Notepad++ (Windows): opens JSON as text; the JSON Viewer plugin adds a tree.
- Sublime Text, Vim, Nano: all open
.jsonas plain text.
Open a JSON file on Windows
- Right-click the
.jsonfile and choose Open with. - Pick Notepad, VS Code, or your browser.
- To make it the default, choose Open with › Choose another app, pick the app, and tick Always use this app to open .json files.
Notepad shows JSON unformatted (often on one line). To read it, paste it into the JSON Formatter.
Open a JSON file on a Mac
- Right-click (or
Control-click) the file and choose Open With. - Pick TextEdit, VS Code, or a browser.
- To change the default, select the file, press
Cmd+I, expand Open with, choose an app, and click Change All.
Open a JSON file on a phone
On iOS and Android, tap the .json file and choose a text editor or browser, or open a mobile browser and paste the contents into the JSON Viewer, which works on touch screens.
Problem: the JSON is unreadable or too big
- All on one line? It is minified. Pretty-print it with the JSON Formatter or JSON Beautifier.
- Huge file? Editors can choke on large JSON. The JSON Viewer lets you collapse sections to navigate it.
- Looks broken? Check it with the JSON Validator, which points to the exact error, or auto-repair it in the JSON Repair tool.
- Opens in the wrong app? Use Open with (above) to pick the right one and set it as default.
A note on safety
JSON files often contain sensitive data: access tokens, API keys, config secrets, or personal information. Many "open JSON online" websites upload your file to their servers to process it, which is a real leak risk. The tools here run entirely in your browser and make zero network requests, so your file is never uploaded, logged, or seen by anyone. You can confirm it: open your browser's developer tools, watch the Network tab, and use any tool, nothing leaves the page.
Frequently asked questions
What program opens a JSON file?
Any text editor or web browser opens a .json file, because it is plain text. For a readable, colored, collapsible view use a JSON viewer or a code editor like VS Code. Notepad (Windows) and TextEdit (Mac) also work but show it unformatted.
How do I open a JSON file in a browser?
Drag the .json file onto an open browser tab, or press Ctrl+O (Cmd+O on Mac) and choose the file. Chrome and Firefox display the JSON as text. For a formatted tree with folding and search, paste it into an online JSON viewer instead.
How do I open a JSON file on Windows?
Right-click the file, choose Open with, and pick Notepad, VS Code, or your browser. To always use one of them, choose Open with, then Choose another app, and tick Always use this app.
How do I open a JSON file on a Mac?
Right-click (or Control-click) the file, choose Open With, and pick TextEdit, VS Code, or a browser. TextEdit opens it as plain text; a JSON viewer or code editor shows it formatted and colored.
Why is my JSON file all on one line?
It has been minified: whitespace was removed to save space. It is still valid; it is just hard to read. Paste it into a JSON formatter to pretty-print it with indentation and colors.
Is it safe to open a JSON file online?
It depends on the tool. Many online viewers upload your file to their servers. This site processes everything in your browser with zero network requests, so a .json file containing tokens, keys, or personal data never leaves your machine. Verify it yourself in the browser's Network tab.