Code and Web File Extensions: HTML, JSON, PY, JS and More
Code and data files are plain text that programs read or run. Any text editor can open them, but some, such as .exe, .ps1 and .js files from unknown sources, can run code on your computer, so treat them with care.
- .html, .htm (HyperText Markup Language): Web pages and website templates
- .json (JavaScript Object Notation): Web API requests and responses
- .xml (Extensible Markup Language): Data exchange between business and government systems (e-invoices, tax filings)
- .py, .pyw, .pyc, .ipynb (Python Source Code): Automation scripts for files, spreadsheets and web tasks
- .ps1, .psm1, .psd1 (Windows PowerShell Script): Automating Windows setup and maintenance tasks
- .js, .mjs, .cjs (JavaScript Source Code): Interactive behaviour on websites
- .exe (Windows Executable): Installing software, drivers and games on Windows
- .yaml, .yml (YAML Ain't Markup Language): Docker Compose and Kubernetes configuration
- .sh, .bash, .zsh, .command (Shell Script): Installing and setting up software and developer environments
A .html or .htm file is a web page written in HyperText Markup Language. It is plain text with tags that describe headings, paragraphs, links, images and forms, which a web browser renders as a formatted page. Double-clicking an HTML file opens it in your default browser; any text editor can edit it.
A .json file is a plain text data file in JavaScript Object Notation, a lightweight format of names, values, lists and nested objects. It is the standard way web APIs exchange data and a common format for app settings, exports and configuration. Any text editor opens JSON, and browsers can display it nicely.
A .xml file is a plain text data file in Extensible Markup Language, which stores information in nested, self-describing tags such as <invoice> and <total>. It is used for data exchange, configuration, sitemaps, RSS feeds and document formats. Any text editor or browser can open an XML file.
A .py file is a Python script: a plain text file of Python source code that the Python interpreter runs. It is used for automation, data analysis, web back ends, machine learning and teaching. You can open and read any .py file in a text editor, but running one requires Python to be installed.
A .ps1 file is a PowerShell script, the file extension Microsoft uses for scripts written in its PowerShell command-line language. It contains plain text commands that automate Windows and server administration tasks. Double-clicking a .ps1 opens it in Notepad rather than running it, a deliberate safety measure.
A .js file is a JavaScript source code file. Websites load JS files to add interactivity, and Node.js runs them as programs and tools on servers and computers. It is plain text you can read in any editor. Be careful: on Windows, double-clicking a .js file can run it as a script.
A .exe file is a Windows executable: a compiled program that runs when you open it. Installers, apps and games on Windows are EXE files. Because running one gives it the same access to your computer that you have, only open EXE files from sources you trust. Macs, iPhones and Android cannot run them natively.
A .yaml or .yml file is a plain-text data file in YAML, a human-friendly format that uses indentation instead of brackets to structure lists and key-value pairs. It is the standard for configuration in Docker Compose, Kubernetes, GitHub Actions, Ansible and many apps. Both extensions mean exactly the same thing.
A .sh file is a shell script: a plain-text list of commands for a Unix shell such as bash or zsh, run on Linux, macOS and Windows through WSL or Git Bash. Shell scripts automate installs, builds, backups and server tasks. They run with your permissions, so read one before running it.
See all file extensions, or rename many files at once with the free online bulk renamer.