How to open .JS files (JavaScript) on Android, Windows and Linux
What JS, MJS, CJS, JSX, TS and TSX files are and how to open and edit JavaScript and TypeScript for free on Android, Windows and Linux, without running them.

You’ve unzipped a website template, a browser extension or someone’s Node.js project, and you want to read app.js or Header.tsx on your phone, or on a PC that has no code editor. Or an email arrived with an attachment called invoice.js, and you’d like to know what it is without running it.
Folders opens JavaScript and TypeScript files in its built-in text editor, with syntax highlighting, line numbers, search and Go to line, on Android, Windows and Linux. You can edit and save them. It never runs them.
What is a .JS file?
A .js file holds JavaScript, the programming language of the web. Browsers run it to make pages interactive, and runtimes like Node.js, Deno and Bun run it on servers and computers. It’s plain text, so any text editor can show it; what differs between apps is how readable they make it.
The related extensions tell tools how to treat the code:
| Extension | What it is |
|---|---|
| .js | JavaScript. In Node.js it’s treated as CommonJS or as an ES module depending on the "type" field in package.json |
| .mjs | JavaScript that is always an ES module (import and export) |
| .cjs | JavaScript that is always CommonJS (require() and module.exports) |
| .jsx | JavaScript with JSX, the HTML-like syntax used by React |
| .ts | TypeScript: JavaScript plus type annotations, developed by Microsoft |
| .tsx | TypeScript with JSX |
Browsers don’t run TypeScript or JSX directly. Build tools such as the TypeScript compiler (tsc), Babel, esbuild or Vite turn them into plain .js first. Deno and Bun run TypeScript directly, and recent Node.js versions can run simple TypeScript files by stripping the types.
You’ll also meet app.min.js, a minified copy squeezed onto as few lines as possible for faster downloads, and app.js.map, a source map in JSON that links minified code back to the original.
How to open a .JS file with Folders
On Android
- Install Folders from the download section (Android 7.0 or newer).
- Tap Allow access when Folders asks for All files access.
- Browse to the project folder, or type the file name or
.jsinto the search box at the top. - Tap the file. If it’s still inside a ZIP, tap it inside the archive; there’s no need to extract the whole project.
Sent through a chat or email app? Choose Open with → Folders.
On Windows and Linux
- Install Folders on Windows 10 or 11 (64-bit) or Linux.
- Double-click the file in Folders.
- On Windows, for .mjs, .cjs, .jsx, .ts and .tsx files you can also right-click in File Explorer and choose Open with → Folders.
Plain .js files are the exception on Windows. Windows keeps .js for its built-in Windows Script Host, which runs a .js file when you double-click it, so Folders isn’t added to the short Open with list for that type. Right-click, choose Open with → Choose another app and pick Folders there, or simply open the file from inside Folders.
What you can do with it in Folders
- Syntax highlighting colours keywords, strings (including template literals in backticks), comments, numbers, type names and decorators such as
@Component, with line numbers down the side. The colours come from general patterns rather than a full JavaScript parser, so JSX markup in .jsx and .tsx files is only partly coloured. - Tabs keep several files open at once: a component, its test and its stylesheet, say.
- Find and Find and replace, with Match case, for renaming a variable within a file.
- Go to line jumps straight to the line in a stack trace such as
at render (App.jsx:42:15). - Word wrap makes long lines readable, and you can make the text smaller or larger.
- Document info shows the cursor’s line and column, the encoding (such as UTF-8) and the line endings. Windows-style CRLF versus Unix-style LF endings explain those diffs where every line seems to have changed.
- Open in hex viewer shows the raw bytes, to spot a byte order mark or a stray invisible character.
- Undo, redo, edit and Save.
Very large files, like a bundled script several megabytes long, are shown without colours to keep things responsive.
Folders is a reader and quick editor, not an IDE: it doesn’t run code, install packages, build, lint, check types or autocomplete. For package.json and other JSON files there’s Format JSON; see how to open JSON files.
Other ways to open .JS files
- Visual Studio Code (free, Windows and Linux): the usual full editor for JavaScript and TypeScript, with autocomplete, type checking and debugging.
- Node.js, Deno or Bun to run a script, for example
node app.js. - Your browser’s developer tools: the Sources panel shows, pretty-prints and debugs the scripts a page loads.
- Acode (free, open source) is a code editor for Android if you write code on your phone regularly.
Problems opening a .JS file?
- Everything is on one or two enormous lines. The file is minified. Turn on word wrap and use Find, or look in the project for the original source; minified files aren’t meant to be edited by hand.
- A .ts file shows garbled characters. Not every .ts file is TypeScript. MPEG transport stream videos from TV recorders, camcorders and downloaded streams use .ts too. Folders checks what’s inside a .ts file before opening it, so a video goes straight to its video player instead of the text editor. If another text editor shows nonsense, it’s one of these videos.
- Double-clicking it on Windows did something. That was Windows Script Host running the file. Malware often arrives as a .js file in an email or inside a ZIP for exactly this reason. Opening it as text in Folders is harmless and lets you see what it would have done.
- Odd characters appear in strings. The file was saved in a different encoding from the one being used to read it. Document info shows which encoding Folders read it with.
Questions people ask
How do I run a .js file? Install Node.js and run node file.js in a terminal, or load it in a web page with a script tag. Folders opens scripts as text and never runs them.
Is a .js file safe to open? Reading it is safe. Running a script from someone you don’t know isn’t, especially on Windows, where a double-click runs it.
.js vs .mjs vs .cjs: what’s the difference? The code is the same language. The extension tells Node.js which module system to use: .mjs for ES modules, .cjs for CommonJS, and .js for whatever package.json says.
How do I convert TypeScript to JavaScript? Compile it with tsc or a bundler such as esbuild or Vite. Folders doesn’t compile code.
Related guides: how to open Markdown and code files, how to open JSON files and how to open HTML files. Or browse all 382 file types Folders opens.
Keep reading
How to open .C files (C and C++ source code) on Android, Windows and Linux
What .c, .h and .cpp files are and how to open, read and edit C, C++ and Objective-C source code for free on Android, Windows and Linux, with no IDE needed.
How to open .CS files (C# source code) on Android, Windows and Linux
What .cs, .csproj, .sln, .vcxproj and .xaml files are and how to open and edit C# code and Visual Studio projects for free on Android, Windows and Linux.
How to open .CSS files (style sheets) on Android, Windows and Linux
What CSS, SCSS, Sass and Less files are and how to open, read and edit style sheets for free on Android, Windows and Linux, with colours, search and replace.



