# MicroPython

> A small Python that runs on tiny chips. You type it live on the board.

**Field:** Software Development  
**Category:** Embedded & IoT  
**Also known as:** Micro Python, CircuitPython

## Think of it like

It is like a small Python. It can live in a tiny chip.

## Definition

MicroPython is a small version of the Python 3 language made to run on microcontrollers. It fits in as little as 256 kilobytes of code space and 16 kilobytes of memory. You plug in a board and type Python at a prompt on the chip itself. A line like turn this pin on works at once, with no compile step. That makes it a quick way to learn and test hardware.

## Example

Jack plugs in an ESP32 that runs MicroPython. He types two lines at the prompt, and the LED on pin 2 lights up.

## Example code

```python
from machine import Pin
led = Pin(2, Pin.OUT)
led.value(1)
```

Three lines at the chip's prompt set pin 2 as an output and turn it on.

## Why it matters

If you know Python, you can code a board. You do not need to learn C first.

## Common mistake

Expecting full Python. Many big libraries do not fit, and the code runs slower than C on the same chip.

## Three principles

- **Python on a chip.** The same language, made small.
- **Live prompt.** Type a line and see it run.
- **Small and slower.** Fewer libraries than full Python.

## Related terms

- [Python](https://learn.benibix.com/term/development/python)
- [Microcontroller (MCU)](https://learn.benibix.com/term/development/microcontroller)
- [ESP32 Microcontroller](https://learn.benibix.com/term/development/esp32)
- [Firmware](https://learn.benibix.com/term/development/firmware)
- [General-Purpose Input/Output (GPIO)](https://learn.benibix.com/term/development/gpio)

![Three boards side by side. Arduino Uno: a microcontroller board with no operating system, running one sketch in a loop. ESP32: a microcontroller with Wi-Fi and Bluetooth built in. Raspberry Pi, lit up: a single-board computer that runs Linux, with a desktop, files and many programs at once. Under the row, a breadboard with a few wires shows where parts are pushed in to test a circuit without solder.](https://learn.benibix.com/diagrams/dev4-dev-boards.svg)

---

Source: https://learn.benibix.com/term/development/micropython
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.
