What is a .erl file?
Erlang Source File · Code and data · Ericsson · 1986
An .erl file is Erlang source code, a language built at Ericsson for telephone switches that must never stop. Its runtime excels at massive concurrency and powers systems like RabbitMQ and WhatsApp's backend.
What is a .erl file used for?
Erlang programs are built from millions of tiny isolated processes that crash and restart independently, the 'let it crash' philosophy. That design gives phone switches, message brokers and chat backends their famous uptime.
An .erl file holds a module; .hrl files are shared header/include files. Elixir runs on the same BEAM virtual machine and interoperates with Erlang code directly.
How to open a .erl file
The .erl format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list. For a step-by-step walkthrough, see how to open a .erl file.
Windows
- VS Code (Erlang LS)
- any text editor
macOS
- VS Code (Erlang LS)
- any text editor
Linux
- VS Code (Erlang LS)
- Emacs (erlang-mode)
- any text editor
How to convert a .erl file
You can convert a .erl file to beam (bytecode) using a conversion tool or the export menu of an app that opens it.
.erl file signature (magic bytes)
Programs recognise a .erl file by the bytes at the start of the file, not by its name. These are the signatures for Erlang.
| Hex signature | Offset | Note |
|---|---|---|
| (no fixed signature) | 0 | plain text; no fixed magic bytes |
See the full magic-numbers reference for every format.
Frequently asked questions
What is a .erl file?
An .erl file is Erlang source code, a language built at Ericsson for telephone switches that must never stop. Its runtime excels at massive concurrency and powers systems like RabbitMQ and WhatsApp's backend.
How do I run an .erl file?
Compile it in the Erlang shell with c(module). and call its functions, or use rebar3 to build a project. The erl shell comes with the Erlang/OTP install.
What is the difference between .erl and .hrl?
An .erl file is a module with code; an .hrl file is a header holding shared record definitions and macros that modules include.
What is the relationship between Erlang and Elixir?
Both run on the BEAM virtual machine. Elixir adds a friendlier syntax and modern tooling, and the two languages can call each other's code directly.
Related formats
Sources
Details on this page were checked against authoritative references: