Code File Formats

Source code files are plain text with opinions — the extension tells your editor what language to highlight and what interpreter to use.

Formats 40
Most common .bat, .c, .clj
About code files

Source code files are plain text with opinions. The extension tells your editor what language it's looking at so it can colour the syntax and yell at you about semicolons. There's nothing special about a .py or .js file — it's a text file that a specific interpreter or compiler knows how to read.

The category spans everything from shell scripts (a few lines that automate a task) to full application source code (millions of lines across thousands of files). JavaScript runs in browsers. Python runs everywhere else. C and Rust run close to the metal. Java runs on the JVM. The file format is the least interesting part — it's the language, its ecosystem, and its tooling that matter.

Safety-wise, code files deserve respect. A .js, .py, or .sh file can execute arbitrary commands on your machine. Downloading and running code from untrusted sources is functionally identical to downloading and running an executable — the only difference is that you can read the source first. Whether you actually do is between you and your risk tolerance.

All code formats
.bat BAT is a Windows batch script — automating Command Prompt ta... .c C is one of the most foundational programming languages — us... .clj Clojure is a modern Lisp for the JVM — functional, immutable... .cpp C++ extends C with object-oriented features — powering game ... .css CSS is the stylesheet language for the web — controlling lay... .dart Dart is Google's language for Flutter — build cross-platform... .diff A diff file shows the line-by-line differences between two v... Dockerfile Dockerfile contains instructions for building a Docker conta... .erl Erlang is the language that keeps phone networks and WhatsAp... .ex Elixir is a functional language for building scalable, fault... .go Go is a programming language designed at Google — built for ... .graphql GraphQL is a query language for APIs — clients ask for exact... .hs Haskell is a purely functional programming language — refere... .html HTML is the markup language that structures every web page —... .ipynb Jupyter Notebooks combine live code, equations, visualisatio... .java Java is a widely used programming language — running Android... .js JavaScript is the programming language of the web — the only... .jsx JSX is a JavaScript file containing HTML-like syntax — the s... .kt Kotlin is Google's preferred language for Android developmen... .lua Lua is a lightweight embeddable scripting language used in g... Makefile Makefiles define build rules and task automation — the origi... .patch A patch file contains diffs that can be applied to source co... .php PHP is a server-side scripting language — powering WordPress... .pl Perl is a powerful text-processing language — the 'Swiss Arm... .ps1 PS1 is a PowerShell script — Microsoft's modern shell for Wi... .py Python is a high-level programming language known for its re... .r R is the language of statisticians — purpose-built for data ... .rb RB is a Ruby source file — the language behind Ruby on Rails... .rs Rust is a systems programming language focused on safety and... .scala Scala blends object-oriented and functional programming on t... .scss SCSS is a CSS preprocessor syntax — adding variables, nestin... .sh SH is a Unix shell script — automating command-line tasks, d... .svelte Svelte compiles components into efficient vanilla JavaScript... .swift Swift is Apple's modern programming language — the primary l... .tf Terraform files define cloud infrastructure as code — create... .tsx TSX is a TypeScript file containing JSX — React components w... .ts TypeScript is Microsoft's typed superset of JavaScript — it ... .vue A Vue SFC combines HTML template, JavaScript logic, and CSS ... .wasm WebAssembly is a compiled binary format for near-native brow... .zig Zig is a systems programming language designed to replace C ...
Safety notes
.bat Use caution

Batch files can execute any system command. Never run a .bat file from an untrusted source.

.clj Use caution

Source code file. Safe to read.

.dart Use caution

Source code file. Safe to read.

Dockerfile Use caution

Dockerfiles can download and execute arbitrary software. Review before building.

.erl Use caution

Source code file. Safe to read.

.ex Use caution

Source code file. Safe to read.

.hs Use caution

Source code file. Safe to read.

.html Use caution

HTML files can contain embedded scripts. Open files from unknown sources in a browser's sandbox, not as local files with full permissions.

.ipynb Use caution

Jupyter Notebooks can execute arbitrary code. Only open notebooks from trusted sources.

.js Use caution

JavaScript files can execute code. Only run JS files from trusted sources.

.jsx Use caution

Source code files can execute arbitrary code. Only run code from trusted sources.

.lua Use caution

Script file. Safe to read but can execute arbitrary code when run with a Lua interpreter.

Makefile Use caution

Contains shell commands that execute when you run `make`. Review before running.

.php Use caution

PHP files execute server-side code. Only run on trusted servers.

.pl Use caution

Script file. Safe to read but executes arbitrary code when run.

.ps1 Use caution

PowerShell scripts can execute any system command with elevated privileges. Never run from untrusted sources.

.py Use caution

Python scripts can execute arbitrary code. Only run .py files from trusted sources.

.r Use caution

Script file. Safe to read but executes arbitrary code when run with the R interpreter.

.rb Use caution

Script files can execute arbitrary code. Only run from trusted sources.

.scala Use caution

Source code file. Safe to read.

.sh Use caution

Shell scripts can execute any system command. Never run a .sh file from an untrusted source.

.svelte Use caution

Source code file. Safe to read but executes when compiled and run.

.tsx Use caution

Source code files can execute arbitrary code. Only run code from trusted sources.

.ts Use caution

Source code file. Safe to read but can execute arbitrary code when compiled and run.

.vue Use caution

Source code file. Safe to read but executes when built and served.

.zig Use caution

Source code file. Safe to read.

FAQ
Can I open code files in a regular text editor?
Yes — all source code files are plain text. Notepad, TextEdit, or any text editor can open them. But a code editor like VS Code (free) provides syntax highlighting, auto-completion, error detection, and integrated terminals that make the experience dramatically better.
What programming language should I learn first?
Python for general-purpose programming and data science. JavaScript for web development. Both have massive communities, extensive documentation, and gentle learning curves. The 'best' language depends on what you want to build.
Are code files safe to open?
Opening (reading) code files is safe — they're text. Running (executing) code files is not inherently safe. A Python script or shell script can do anything your user account can do. Only run code from sources you trust, and read it first if you can.
Related categories