Home / Hardware and Performance / Arduino Serial Monitor

Arduino Serial Monitor in JavaScript, Free with Live Demo

Free serial monitor and plotter in plain JavaScript. Talk to an Arduino, ESP32 or Pico over USB with the Web Serial API, send commands and plot numbers live.

Open live demoDownload HTML fileView code on GitHub
Arduino Serial Monitor JavaScript project: read and plot data from an Arduino or ESP32 over USB

Runs on: Web Serial. Chrome and Edge on desktop, and Opera. Not in Safari, Firefox or mobile browsers. Needs HTTPS or localhost.

What is the Arduino Serial Monitor?

Plug in an Arduino or ESP32, pick the port and read everything it prints, with timestamps. Numbers in each line are drawn on a live chart like the Arduino IDE plotter, and you can send commands back.

The Web Serial API opens the USB port at the baud rate you choose. Bytes flow through a TextDecoderStream and a small line splitter, and a simulator lets you try it without a board.

Good for

  • Arduino and ESP32 projects
  • Classroom electronics
  • Sensor logging
  • Tools for makers without installing an app

What this project does

How it works

  1. Open the portYou choose the port in the browser's picker. The page opens it at the baud rate your board uses.
  2. Read linesBytes flow through a TextDecoderStream and a small TransformStream that splits on new lines.
  3. PlotEach line is checked for numbers. If it has any, they are added to the chart as separate colored lines.

The key JavaScript

This is the heart of the project. The full file has the rest, including the screen layout and error handling.

const port = await navigator.serial.requestPort();
await port.open({ baudRate: 115200 });

const lines = port.readable
  .pipeThrough(new TextDecoderStream())
  .pipeThrough(new TransformStream({
    transform(chunk, ctl) { (this.buf = (this.buf ?? "") + chunk).split("\n").slice(0, -1).forEach((l) => ctl.enqueue(l)); this.buf = this.buf.slice(this.buf.lastIndexOf("\n") + 1); },
  }));
for await (const line of lines) show(line);

const writer = port.writable.getWriter();
await writer.write(new TextEncoder().encode("LED ON\n"));

How to use it

  1. Click Download HTML file above.
  2. Open the file in a code editor, like VS Code.
  3. Run it from a local server with npx serve . so the camera, microphone and AI features are allowed.
  4. Change the text and colors, then upload it to GitHub Pages, Netlify or your own site. It is one file with no build step.

Questions people ask

Which browsers support Web Serial?

Chrome, Edge and Opera on desktop. It is not in Safari, Firefox or mobile browsers.

What baud rate should I use?

The same one as Serial.begin() in your sketch. 115200 is the most common.

How do I plot values?

Print numbers on one line, like temp:24.5 humidity:61. The plotter draws up to four values per line.

More Hardware and Performance projects