--- title: ".js file — what it is and how to open it" description: "A .js file is a JavaScript Source. The programming language of the web, in a plain-text file. How to open one on Windows, macOS and Linux, and what to convert it to." url: https://atoneplace.net/file/js/ site: "At One Place" --- # .js files **.js file: JavaScript Source** The programming language of the web, in a plain-text file. ## What opens a .js file - **Windows:** Visual Studio Code, Notepad++, Notepad (built in) - **macOS:** Visual Studio Code, TextEdit (built in), BBEdit - **Linux:** Visual Studio Code, Text Editor (built in), Vim - **In a browser:** CodeSandbox, JSFiddle ## What a .js file is JavaScript runs in every browser and, through Node.js, on servers and desktops too; the language is standardised as ECMAScript. A .js file is readable text, so any editor opens it — but a downloaded .js can also be a script Windows will execute if you double-click it, which is a long-standing malware route. Open unknown ones in an editor rather than launching them. ## Converting it A .js file is commonly converted to .ts, .mjs or .txt. It is a plain text format, so any text editor can open and edit it directly. ## Details - **Extension:** .js - **Full name:** JavaScript Source - **Category:** Code and scripts - **MIME type:** text/javascript - **Created by:** Brendan Eich / Ecma International - **Format:** Plain text ## Common questions ### How do I open a .js file? On Windows use Visual Studio Code; on macOS use Visual Studio Code; on Linux use Visual Studio Code. The programming language of the web, in a plain-text file. ### What is a .js file? JavaScript Source. JavaScript runs in every browser and, through Node.js, on servers and desktops too; the language is standardised as ECMAScript. A .js file is readable text, so any editor opens it — but a downloaded .js can also be a script Windows will execute if you double-click it, which is a long-standing malware route. ### Can I convert a .js file? Yes. It is usually converted to .ts, .mjs or .txt, either by exporting from one of the programs listed above or with a format converter. ## Related pages - [.html — HyperText Markup Language](https://atoneplace.net/file/html/) - [.css — Cascading Style Sheet](https://atoneplace.net/file/css/) - [.py — Python Source](https://atoneplace.net/file/py/) - [.java — Java Source](https://atoneplace.net/file/java/) - [.tsx — TypeScript Source (JSX)](https://atoneplace.net/file/tsx/) - [.cpp — C++ Source](https://atoneplace.net/file/cpp/) - [.php — PHP Source](https://atoneplace.net/file/php/) - [.c — C Source](https://atoneplace.net/file/c/) - [.cs — C# Source](https://atoneplace.net/file/cs/) - [.go — Go Source](https://atoneplace.net/file/go/) - [.rs — Rust Source](https://atoneplace.net/file/rs/) - [.rb — Ruby Source](https://atoneplace.net/file/rb/) ## Sources - Media Types Registry — IANA (https://www.iana.org/assignments/media-types/) - Official vendor product documentation — At One Place (/about/)