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 57
Most common .babelrc, .bat, .c
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
.babelrc Babel transpiler config — which JavaScript syntax to compile... .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... .dockerignore Tells `docker build` which files to skip when sending the bu... .editorconfig Cross-editor formatting rules — indent size, charset, line e... .erl Erlang is the language that keeps phone networks and WhatsAp... .eslintrc Legacy ESLint config — code style and quality rules for Java... .ex Elixir is a functional language for building scalable, fault... Gemfile The Ruby project's dependency manifest — Bundler reads this ... .gitattributes Per-path git settings — line endings, merge strategies, LFS ... .gitignore Tells git which files to skip when staging, committing, or p... .gitmodules Git submodule manifest — declares which external repos are p... .go Go is a programming language designed at Google — built for ... .graphql GraphQL is a query language for APIs — clients ask for exact... .helmignore Helm chart packaging exclusions — gitignore-style file decla... .hs Haskell is a purely functional programming language — refere... .htaccess Apache web server config dropped into a directory — URL rewr... .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... .npmrc npm configuration — package registry, auth tokens, install b... .nvmrc A single line of text containing the Node.js version this pr... .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... .prettierrc Prettier's config — opinionated code formatting rules. Tells... Procfile Heroku-style declaration of which processes run your app — `... .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 ... Rakefile Ruby's answer to Make — define tasks like `rake test`, `rake... .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 ... Vagrantfile HashiCorp Vagrant's VM config — Ruby DSL describing a virtua... .vue A Vue SFC combines HTML template, JavaScript logic, and CSS ... .wasm WebAssembly is a compiled binary format for near-native brow... .yarnrc Yarn Classic config — registry, install behaviour, network s... .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.

.htaccess Use caution

A single syntax error will break the entire directory with a 500 error. Always keep a backup before editing.

.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.

.npmrc Use caution

May contain auth tokens for private registries. Never commit a project .npmrc with hardcoded tokens — use environment variable interpolation instead.

.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.

Rakefile Use caution

Rakefiles execute Ruby code. Review unfamiliar Rakefiles before running `rake` against them.

.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.

Vagrantfile Use caution

Vagrantfiles execute Ruby and run provisioning scripts. Review before `vagrant up` — they can download and run arbitrary code from the network.

.vue Use caution

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

.yarnrc Use caution

May contain auth tokens for private registries. Use environment variable interpolation rather than hardcoded tokens, and never commit auth-bearing .yarnrc files.

.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