Ask a parent, teacher, or trusted adult before building, powering a circuit, using tools or batteries, or buying parts. Purchases are optional and at your own cost. If anything gets hot, smells burnt, leaks, swells, sparks, or moves unexpectedly, switch off or disconnect power without touching the damaged or hot part, then tell an adult. Read safety rules

Free online Arduino simulator

Run your Arduino sketch online — no download

A free Arduino simulator that runs right in your browser. No install, no sign-up, no hardware — write a sketch, press Run, and watch simplified virtual LEDs, a buzzer, a servo, and the Serial Monitor. It is a learning model, not proof that real wiring is correct or safe.

Loaded from the code library: Ultrasonic distance. Press Run to watch it work, then read the line-by-line explanation.

simulator.ino
Serial Monitor0 ms
Press Run — anything you Serial.println() appears here…

Simulator guide — from empty editor to working sketch

New to the simulator? Follow these six steps once and you will know every part of the page.

  1. STEP 1

    Pick or paste a sketch

    Choose one of the seven examples above the editor, or delete everything and paste your own Arduino code. A sketch needs a void setup() and a void loop() to run.

  2. STEP 2

    Press Run

    The simulator reads your code line by line, just like a real board uploads it. If something is missing, a red message under the buttons tells you exactly what to fix.

  3. STEP 3

    Watch the virtual board

    Every pin your sketch sets to OUTPUT appears as an LED on the right. Brightness follows analogWrite(). The buzzer, servo dial and Serial Monitor update as the code runs.

  4. STEP 4

    Feed it input

    Drag the Sensor on A0 slider up or down and hold the Button on pin 2 while the sketch is running. Sketches that read analogRead() or digitalRead() react straight away.

  5. STEP 5

    Change something and rerun

    Stop the sketch, change a number — a delay, a pin, a threshold — and press Run again. Predict first, then check. That is how you learn to read code.

  6. STEP 6

    Take it to a real board

    When a sketch works here, build it for real with a trusted adult. Use a project from the library so the wiring and power match the code.

What every control does

Code editor
A normal text box. Type, paste and edit like any sketch.ino file. Reset puts the chosen example back.
Run / Stop
Run starts the sketch from the beginning. Stop halts it — press Run to restart from scratch.
Speed
Runs time faster or slower: 0.5× is half speed for slow readers, 5× flies through long delays.
Serial Monitor
Shows everything Serial.println() prints, plus the elapsed milliseconds on the timer.
Virtual board LEDs
One round LED per OUTPUT pin, labelled D-pin number. They glow brighter with bigger analogWrite values.
Sensor on A0
One slider standing in for any analog sensor: light, a dial or a thermometer, 0–1023.
Button on pin 2
Press and hold. With INPUT_PULLUP the pin reads LOW while held, matching a real wired button.

If something looks wrong

  • "Your sketch needs a void setup() and a void loop()." Every sketch has both, even if setup() is nearly empty.
  • Nothing moves. Your loop() probably has no delay(). Add one, like delay(500).
  • The LED never lights. Check the pin in digitalWrite matches the pin you set to OUTPUT, and that the board shows that pin at all.
  • A part of your code is ignored. The simulator understands the simple style used on this site — setup, loop, if, for, while, arrays and the Servo library. Fancy libraries may be skipped silently.

Where to go next

Read what each line does in the code library, build the real thing from a step-by-step project, learn the theory in the lessons, or test yourself with a challenge. The safety page covers power, batteries and getting an adult involved before you build for real.