What is a .ex file?
Elixir Source File · Code and data · José Valim · 2011
An .ex file is Elixir source code, a functional language that runs on the Erlang virtual machine (BEAM). It is built for scalable, fault-tolerant systems, and powers the Phoenix web framework.
What is a .ex file used for?
Elixir brings a friendly, Ruby-inspired syntax to the battle-tested Erlang runtime, which excels at concurrency and staying up under load. Compiled .ex files build a project; .exs files are scripts run directly.
It is popular for real-time web apps and distributed systems. The files are plain text; VS Code with ElixirLS is the usual editor.
What opens a .ex file?
The .ex format opens in the following apps, grouped by operating system. If one app does not work, try another from the same list.
Windows
- VS Code (ElixirLS)
- any text editor
macOS
- VS Code (ElixirLS)
- any text editor
Linux
- VS Code (ElixirLS)
- any text editor
Open a .ex file step by step
- Confirm the file really is a .ex. Drop it into the WhatFileType identifier, which reads its signature in your browser without uploading anything.
- On Windows, open it with VS Code (ElixirLS) or any text editor.
- On Mac, use VS Code (ElixirLS) or any text editor.
- On Linux, try VS Code (ElixirLS) or any text editor.
- Still stuck? Search for a dedicated Elixir viewer rather than a generic one.
Why can't I open my .ex file?
Almost always because no installed app understands Elixir. Install one of the apps above, or convert the file to a format your existing software already reads. If double-clicking opens the wrong program instead of nothing at all, the file association is set to the wrong app rather than the file being broken.
The other possibility is that the file is not really a .ex at all. Drop it into the file identifier to check it by its bytes instead of its name. Nothing is uploaded.
Elixir has no fixed magic number, so there is no signature table on this page. Its bytes alone do not prove the format: identification relies on the extension, the structure of the content and the program that created it. The magic-numbers reference lists the formats that do carry one.
Frequently asked questions
What is a .ex file?
An .ex file is Elixir source code, a functional language that runs on the Erlang virtual machine (BEAM). It is built for scalable, fault-tolerant systems, and powers the Phoenix web framework.
What is the difference between .ex and .exs?
A .ex file is compiled as part of a project; a .exs file is a script Elixir runs directly, without a build step. Both are Elixir source.
How do I run an Elixir file?
Run a script with elixir file.exs, or build and run a project with mix, Elixir's build tool.
Why is Elixir good for scalable apps?
It runs on the Erlang BEAM, which was designed for massive concurrency and fault tolerance, so Elixir handles many simultaneous connections reliably.
Related formats
Sources
Details on this page were checked against authoritative references. How sources are ranked and what is deliberately left out is set out in the methodology.