JS File Viewer & Editor

Open, read and edit JavaScript files right in your browser - no IDE, no Node, nothing to install. Beautify minified code, spot syntax errors by line and column, and explore every function and import. Shrinking code for production? Try the JS/CSS Minifier. Data or styles? Use the JSON Viewer or CSS Viewer.

Syntax check Beautify & minify Outline Try:

How to View a JavaScript File Online

  1. Open your JS file. Drop .js, .mjs, .cjs, .jsx, .ts, .tsx or .json files onto the box, browse for them, or paste code with Ctrl+V. Everything stays in your browser.
  2. Read the highlighted code. The file opens with syntax highlighting, line numbers, word wrap and code folding. A syntax check runs straight away and points to the exact line and column of any error.
  3. Beautify, search and explore. Press Beautify to make minified code readable, search with Ctrl+F (regex supported), jump with Ctrl+G, and open Outline to see every function, class, import and export.
  4. Copy, edit or export. Copy one function, edit in place, download the file, export a line range or highlighted HTML, or grab every open file at once.

Working with other formats? Open them in the CSS Viewer, JSON Viewer, HTML Viewer or XML Viewer.

Browse the full set of 200+ file viewers for everything else.

JS Viewer Features

Fast on big files

Only the lines on screen are drawn, and parsing runs in the background. Multi-megabyte bundles scroll smoothly.

Syntax check

Every file is parsed (never run). Errors show the exact line and column, one click away.

Beautify & minify

Turn a one-line .min.js into readable code, or shrink code with your choice of options. Revert any time.

Regex search

Match case, whole word and regular expressions, with every hit highlighted. Ctrl+G jumps to any line.

Outline

Every function, class, method, import and export with its line number. Copy one function in a click.

Dependency graph

See what a file imports at a glance: relative files, npm packages and Node.js built-ins.

Split view & edit

Compare two files side by side, or edit in place with auto-indent and bracket pairing.

6 code themes

VS Code, GitHub Dark, Monokai, Dracula, GitHub Light, or Auto to follow the site’s dark mode.

About JavaScript Files

JavaScript is the language of the web.

It runs in every browser and - through Node.js - on servers, build tools and command-line apps.

A .js file is plain text, so any editor opens it. Without highlighting and an outline, though, an unfamiliar file is slow to read.

JavaScript file types

  • .js - classic scripts and ES modules, the most common kind.
  • .mjs / .cjs - files that are explicitly ES modules (import) or CommonJS (require) in Node.js.
  • .jsx / .tsx - React components that mix HTML-like tags with code.
  • .ts - TypeScript, JavaScript with type annotations.
  • .json - data in JavaScript object syntax. For a tree view use the JSON Viewer.

When to use an online JS viewer

  • Quick inspection - read a downloaded script or snippet without opening a heavy IDE.
  • Restricted devices - view JavaScript on Chromebooks or work-locked PCs where you can’t install software.
  • Untrusted code - look inside a suspicious script safely, because nothing here ever runs it.
  • Compare versions - load two files side by side to spot what changed.
  • Understand dependencies - see every import at a glance with the dependency graph.
  • Grab one function - copy a single function out of a large file without scrolling.

Minified JavaScript and Source Maps

Websites ship minified JavaScript: comments and spaces removed, names shortened, everything on one line.

The viewer spots minified files automatically and offers to beautify them. Beautify restores indentation and line breaks, but not the original variable names.

Many bundles end with a //# sourceMappingURL= comment that points to a source map with the original sources. The Outline view shows that link - it is never fetched.

Need the opposite? Minify here with optional compress and mangle, or use the JS/CSS Minifier for CSS as well.

Keyboard Shortcuts

KeysAction
Ctrl+FSearch, with match case, whole word and regex
Ctrl+GGo to line
Alt+ZWord wrap on / off
FFull view while the code has focus, Esc to leave
Ctrl+VOpen pasted code as a new file
Ctrl+SApply edits in Edit mode

Frequently Asked Questions

Drag your .js file onto this page and it is syntax-highlighted instantly in your browser.

No VS Code, no Node, no install - it works on any device, including Chromebooks, tablets and work-locked PCs where you can’t install software.

Yes. Files are read locally and never uploaded to any server.

The viewer also never runs your code - it is only parsed and displayed as text, so even a malicious script can’t do anything here.

Open the .min.js file and press Beautify. It re-indents the code and puts each statement on its own line, with your choice of indent size and brace style.

Revert brings the original back. Going the other way? Use Minify here or the JS/CSS Minifier.

Open the file and look at the check bar above the code. It names the line and column of the first syntax error and jumps there in one click.

Files without errors show a green “No syntax errors” message.

Open a second file with Add file, then press Split in the tab bar.

The two files appear side by side and scroll independently - handy for comparing two versions of a module.

Yes. With more than two files open, Download all bundles them into one ZIP with a README inside.

One or two files download directly. You can also export a line range or a highlighted HTML page.

In Outline view the viewer draws every import and require statement as a small graph.

Relative files, npm packages and Node.js built-ins are colour-coded, and clicking a box copies its path.

Modern JavaScript (.js), ES modules (.mjs), CommonJS (.cjs), React JSX (.jsx), TypeScript (.ts, .tsx) and JSON - up to 10 MB each.

ES2025 syntax such as classes, private fields, optional chaining and async/await is fully supported. For other formats, see our 200+ file viewers.

Guides & Tutorials

All 14 guides
Guide How to Tell What Format an Image File Is (5 Easy Ways) Read the guide Guide How to Open ZIP, RAR, 7Z & TAR.GZ Files Online (Without Installing Anything) Read the guide Comparison PNG vs JPG: Which Image Format Should You Actually Use? Read the guide