Home·File extensions

.js

Code · text/javascript

Opens with

VS CodeChromeNode.js

Source files people read and write. Inside they are plain text, so even Notepad opens them.

MIME typetext/javascript
CategoryCode
Opens in a browserYes
Plain textYes
Registered typeYes

How to read this

  • An extension is a label, not the contents. Rename a file to .png and if the bytes inside are JPEG, it is still a JPEG.
  • A MIME type is how the internet names a file kind. Browsers look at that value, not the extension, to decide whether to display or download.
  • A MIME type starting with x- was never registered as a standard. Plenty are in wide use, but they are not official names.
  • Video extensions name a container. The same .mp4 may play on one device and not another, depending on the codec inside.

Frequently asked questions

Q. What is a .js file?

It belongs to the code category and its MIME type is text/javascript. The contents are plain text, so you can even open it in Notepad and read it.

Q. What opens a .js file?

VS Code, Chrome, Node.js all handle it. In a browser it opens directly, with no extra software.

Q. What is the MIME type of .js?

text/javascript. The first half, text, names the broad kind; the second half, javascript, names the exact format. It is a registered standard name.

Q. Can I convert a .js file to another format?

Yes — open it and re-save through a converter. Renaming alone changes only the label; the bytes stay put, and programs that check the real format may refuse to open it.

Q. My .js file will not open.

First check that VS Code is installed. If it still fails, the download may have been cut short, or the file may only be named .js while holding a different format inside.

Same group