When Chrome downloads a JSON file instead of displaying it, the browser is receiving an instruction from the server to treat the content as a downloadable attachment rather than a displayable document. This happens because of incorrect server headers, a misconfigured Chrome flag, or an extension that intercepts responses and changes their handling. In most cases this is fixable in under two minutes by correcting the Content-Type header or enabling Chrome’s JSON viewer flag. This guide covers every cause and every fix.
| Last tested: March 2026 | Chrome latest stable |
Quick Fix Navigate to
chrome://flags/#enable-json-viewerand set to “Enabled”, then restart Chrome. If JSON still downloads, check your server’s Content-Type headers in the Network tab. For immediate viewing right now, install JSON Formatter Pro.
Why Chrome Downloads JSON Files Instead of Displaying Them
Chrome’s decision to display or download a response happens before it shows you anything. That decision is based almost entirely on what the server tells Chrome to do through HTTP response headers.
The Content-Type Header Causes Most Downloads
The server response header Content-Type tells Chrome what kind of content it is receiving and, by extension, how to handle it. When a server sends JSON with Content-Type: application/octet-stream (generic binary) or Content-Type: application/download, Chrome interprets this as a file download instruction and triggers the download behavior regardless of what the actual content is.
Misconfigured web servers are the primary source of this problem. Apache servers without explicit MIME type configuration often fall back to application/octet-stream for file extensions they do not recognize. Nginx behaves similarly. If you control the server, this is almost always the fix.
“Valid JSON syntax is formally defined by the ABNF grammar copied from the IETF JSON standard (RFC 8259). Property names must be double-quoted strings; trailing commas are forbidden.”
Source: JSON - JavaScript Reference - MDN Web Docs — MDN Web Docs
The Content-Disposition Header Forces Downloads
Separate from Content-Type, servers can send a Content-Disposition: attachment header that explicitly tells Chrome to download the content regardless of its type. This header is sometimes added incorrectly to API responses, especially by frameworks that have a download helper function accidentally applied to JSON endpoints.
If your server is sending Content-Disposition: attachment; filename="response.json", Chrome will download it no matter what the Content-Type says. Check for this header in the Network tab’s response headers section.
Chrome’s JSON Viewer Flag Is Disabled
Chrome includes a built-in JSON viewer that can be toggled through the experimental flags system. This viewer is sometimes disabled by corporate policies, Chrome updates, or extension conflicts. When it is disabled, Chrome does not attempt to render JSON in the browser and falls back to downloading it.
This cause is less common than server header issues but worth checking early because it takes about 30 seconds to fix.
Extension Conflicts With JSON Handling
Download manager extensions and some developer tool extensions override Chrome’s default handling for specific content types. Extensions that intercept all file downloads can reroute JSON responses to the download folder before Chrome’s JSON viewer gets a chance to display them.
This is easy to identify: disable extensions and test in an incognito window. If JSON displays correctly there, an extension is causing the download behavior in your regular profile.
How to Fix Chrome Downloading JSON Files
Fix 1: Enable the JSON Viewer Flag
Navigate to chrome://flags/#enable-json-viewer in your address bar. Set the toggle to Enabled. Restart Chrome completely, closing all windows before reopening.
After restarting, navigate to a JSON API endpoint. The content should display in Chrome’s browser window with syntax highlighting and collapsible object trees rather than triggering a download prompt.
This fix works independently of server configuration for responses where the Content-Type header is correct but the viewer feature was simply disabled. If the server is sending an explicitly wrong Content-Type or a Content-Disposition: attachment header, this flag alone will not override those instructions.
Fix 2: Correct the Server Content-Type Header
Open DevTools with F12, click Network, and trigger the request. Click the request entry and check Response Headers. Look for content-type and content-disposition.
If content-type is anything other than application/json, fix the server:
For Apache: add AddType application/json .json to your .htaccess file.
For Nginx: add the MIME type entry to your mime.types configuration file or include default_type application/json in the relevant location block.
For Express.js: use res.json(data) instead of res.send(data), or manually call res.setHeader('Content-Type', 'application/json') before sending.
For Node.js without a framework: call response.writeHead(200, {'Content-Type': 'application/json'}) before writing the response body.
If content-disposition shows attachment, remove that header from your endpoint configuration. It should not be present on API responses.
“The JSON.parse() static method parses a JSON string, constructing the JavaScript value or object described by the string, and returns the JavaScript value.”
Source: JSON.parse() - JavaScript - MDN Web Docs — MDN Web Docs
Fix 3: Clear Cached Download Associations
Chrome can cache download behavior for specific file types or domains. If Chrome once downloaded a JSON response and stored that association, it may continue downloading even after the server headers are corrected.
Press Ctrl+Shift+Delete (Windows) or Cmd+Shift+Delete (Mac) to open the Clear browsing data dialog. Select “Cookies and other site data” and “Cached images and files” with the time range set to “All time.” Clear the data and restart Chrome.
After clearing, Chrome re-evaluates content handling for every URL from scratch rather than using cached associations.
Fix 4: Identify and Disable Conflicting Extensions
Open an incognito window with Ctrl+Shift+N and navigate to the JSON endpoint. If it displays correctly in incognito but downloads in your regular profile, an extension is the cause.
Go to chrome://extensions/ and look for download managers, developer tools extensions, or any extension that modifies how files are handled. Disable them one at a time and retest after each one. Download manager extensions are particularly likely culprits because they are designed to intercept download events, and some of them trigger on content types like application/json that should not be considered downloads.
Once you find the extension causing the conflict, check its settings for a file type exclusion list and add JSON to it.
JSON Formatter Pro: Permanent Solution
Server header fixes work for endpoints you control, but you encounter JSON from servers you do not control regularly. JSON Formatter Pro solves the display problem regardless of server configuration by intercepting JSON responses before Chrome’s download logic activates.
The extension processes the response body directly and renders it as formatted, navigable JSON in the browser window. It handles responses with wrong MIME types, missing headers, and non-standard JSON variants including JSON5 and JSONP. With a 4.8/5 rating and 738KiB installation size, it adds no perceptible weight to Chrome.
Once installed, JSON from any source displays in the browser window with syntax highlighting, collapsible trees, and error validation. No more download prompts for API responses and JSON data files.
Get JSON Formatter Pro at zovo.one
Why This Happens: The Technical Background
The HTTP specification gives servers complete authority over how browsers handle response content. The Content-Type header is part of this design, and browsers are expected to respect it faithfully. When servers send incorrect values, the browser is technically doing its job correctly by downloading what it was told is a downloadable file.
The Chrome JSON viewer flag exists as an override for developers who regularly work with APIs that do not follow standards strictly, but it still has limits. Extensions that format JSON at the response-body level rather than the header level provide the most reliable override.
Quick Fix Summary
| Cause | Fix | Time |
|---|---|---|
| JSON viewer flag disabled | Enable chrome://flags/#enable-json-viewer |
1 minute |
| Wrong Content-Type header | Fix server configuration | 5 minutes |
| Content-Disposition attachment | Remove header from API endpoint | 5 minutes |
| Cached download association | Clear browsing data | 2 minutes |
| Extension intercepting downloads | Disable and identify conflict | 5 minutes |
FAQ
Does this fix work for JSON files hosted on other people’s servers?
Server-side fixes only work for servers you control. For servers you do not control, use the JSON viewer flag or install JSON Formatter Pro, which works regardless of how the third-party server configures its headers.
Why does Chrome download some JSON files but display others?
The difference is the server configuration. Servers that correctly set Content-Type: application/json without a Content-Disposition: attachment header display JSON inline. Servers using generic binary MIME types or attachment disposition trigger downloads. The JSON content itself is identical; only the headers differ.
Can I set Chrome to always display JSON, even from any server?
The Chrome JSON viewer flag helps, but it still defers to Content-Disposition: attachment headers. Installing JSON Formatter Pro is the most complete browser-side solution for always displaying JSON regardless of server configuration.
What if Chrome still downloads JSON after enabling the flag and fixing headers?
Check for a Content-Disposition: attachment header in the response, which overrides the JSON viewer. Also test in incognito to rule out extension conflicts. If the download only occurs on specific domains, those servers are likely sending explicit download instructions that require server-side correction.
Built by Michael Lip — More tips at zovo.one