How to Open JSON Files
A complete guide to opening and viewing JSON files on any platform.
What is a JSON File?
A JSON file is a text file that stores data in JavaScript Object Notation format. JSON files have the .json extension and can be opened with any text editor or specialized JSON viewer.
Quick Methods
How to open a JSON file on Windows
Notepad: Right-click → Open with → Notepad
- Find the .json file in File Explorer.
- Right-click the file and choose Open with, then Notepad. If it is not listed, choose another app and select Notepad.
- Read the JSON as text. For indentation and a separate formatted view, copy it into the online JSON beautifier.
VS Code: Best for large files with syntax highlighting
Browser: Drag and drop into Chrome/Firefox
How to open a JSON file on macOS
TextEdit: Right-click → Open With → TextEdit
- Locate the .json file in Finder.
- Control-click the file, choose Open With, and select TextEdit.
- Read the contents as plain text, or copy them into a JSON viewer to explore nested objects.
Xcode: Built-in JSON viewer with formatting
Preview: Quick Look (press Space in Finder)
How to open a JSON file on Linux
cat/less: cat file.json in terminal
- Open a terminal in the folder containing your .json file.
- Run
cat file.json, replacingfile.jsonwith your filename, to display its contents. - If jq is installed, run
jq . file.jsonfor indented output, or open the file in a text editor to edit it.
jq: jq . file.json for formatted output
gedit/nano: GUI or terminal text editors
How to open a JSON file in a browser
JSON Compare: Our free online JSON viewer
- Drag a local .json file into a new browser tab to view its text.
- For an interactive view, open JSON Tree View from the tools below and select Upload to choose the file.
- Expand objects and arrays to inspect their contents. If the input is invalid, correct the JSON before viewing the tree.
No installation: Works directly in browser
Privacy: Files stay on your device
Recommended Tools by Use Case
For Quick Viewing
- Web Browser: Just drag the JSON file into Chrome, Firefox, or Edge. Modern browsers display JSON with basic formatting.
- Online Viewers: Use our JSON Tree View tool for an interactive, collapsible view.
For Editing
- Visual Studio Code: Free, cross-platform editor with excellent JSON support, syntax highlighting, and validation.
- Sublime Text: Lightweight editor with JSON formatting plugins.
- Notepad++: Windows-only, free editor with JSON plugins.
For Development
- VS Code with extensions: JSON Tools, Prettier for formatting.
- JetBrains IDEs: Built-in JSON support with schema validation.
- Command line (jq): Powerful JSON processor for scripting.
For Large Files
- jq: Command-line tool that handles large files efficiently.
- Dadroit: Desktop app designed for large JSON files.
- fx: Terminal JSON viewer with streaming support.
Opening JSON in Programming Languages
JavaScript/Node.js
// In Node.js
const data = require('./file.json');
// Or using fs
const fs = require('fs');
const data = JSON.parse(fs.readFileSync('file.json', 'utf8'));
// In browser
fetch('file.json')
.then(response => response.json())
.then(data => console.log(data));Python
import json
with open('file.json', 'r') as f:
data = json.load(f)
print(data)Command Line (jq)
# View formatted JSON jq . file.json # Extract specific field jq '.name' file.json # Filter array jq '.users[] | select(.age > 30)' file.json
Troubleshooting
JSON Opens as Text/Code
This is normal! JSON is a text format. If you want formatted viewing, use a dedicated JSON viewer or our online tools.
Cant Open Large JSON Files
Basic text editors may struggle with files over 100MB. Use command-line tools like jq or specialized applications for large files.
JSON Shows Errors
The file may have syntax errors. Use our JSON Validator to find and fix issues.
Frequently asked questions about opening JSON files
What program opens .json files?
A text editor such as Notepad, TextEdit, or Visual Studio Code can open a .json file because JSON is text. Use a JSON viewer when you want to expand nested objects and arrays instead of reading the raw text. You do not need to run the file as a program.
Can I open a JSON file in Notepad?
Yes. Right-click the file in Windows, choose Open with, and select Notepad. It shows the JSON text but does not automatically turn it into a table or a collapsible tree. If everything appears on one line, use the JSON beautifier to add indentation and line breaks.
Can I open a JSON file in Excel?
For spreadsheet viewing, convert a JSON array to CSV and import the CSV into Excel. This is useful for rows of records; a JSON tree viewer is a better fit when you want to inspect nested objects and arrays without turning them into a table.
Open a JSON file online
Use JSON Tree View to open a JSON file online: select Upload, choose your .json file, and expand its objects and arrays. To read or copy indented text instead, use the JSON beautifier. Paste the JSON or select Upload, then copy or download the formatted output.
Try Our Online Tools
View and work with JSON files directly in your browser - no installation required:
Related: generate sample data with the JSON generator if you need a JSON file to practice with.