# Executable File

> A file that holds a program. You can start it and it runs.

**Field:** Software Development  
**Category:** Compilers & Runtimes  
**Also known as:** Executable, EXE File, .exe, ELF, Mach-O, PE File

## Think of it like

It is like a toy that comes already built. You open the box and it is ready to play.

## Definition

An executable file is a program the computer can start and run. Inside is machine code, or code that a runtime knows how to run. On Windows these files often end in .exe. On macOS and Linux they usually have no ending, and a setting marks them as allowed to run. A compiler or a build tool makes them from source code.

## Example

Emma builds her game in C++. The compiler makes game.exe, and her friends run it without any of her source code.

## Example code

```console
$ gcc hello.c -o hello
$ ./hello
Hello, world!
```

The compiler makes a file named hello. Then the file runs.

## Why it matters

It is how software reaches people who never see the code. It is also why you should only run executables you trust.

## Common mistake

Thinking an executable runs on any computer. One built for Windows on an Intel chip will not run on a Mac as it is.

## Three principles

- **Ready to run.** No build step left to do.
- **Built for a system.** Each OS and chip needs its own.
- **Trust it first.** It can do anything you can.

## Related terms

- [Machine Code](https://learn.benibix.com/term/development/machine-code)
- [Compiler](https://learn.benibix.com/term/development/compiler)
- [Linker](https://learn.benibix.com/term/development/linker)
- [Binary File](https://learn.benibix.com/term/development/binary-file)
- [Operating System (OS)](https://learn.benibix.com/term/development/operating-system)
- [Runtime Environment](https://learn.benibix.com/term/development/runtime-environment)

## Told apart from

- [Executable File vs Binary File](https://learn.benibix.com/compare/executable-file-vs-binary-file): A binary file is any file that is not plain text, like a photo or a zip. An executable is one kind. It is a program you can start.

![Source code splits into two paths. On the top path, a compiler turns C code into an executable file of machine code, which the operating system runs straight away. On the bottom path, a compiler turns Java or C# code into bytecode, and a runtime, the JVM or the CLR, turns that into machine code while the program runs.](https://learn.benibix.com/diagrams/dev7-runtimes.svg)

---

Source: https://learn.benibix.com/term/development/executable-file
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
