v148 · Devices · demo

Serial Terminal

Open a serial port, pick baud rate and data bits, then send and receive text. The same navigator.serial code runs on desktop Chrome and Android Chrome 148+.

Checking Web Serial API…
no port

— Connect a serial device to begin —

TX>
Quick send:
const port = await navigator.serial.requestPort();
await port.open({ baudRate: 115200, dataBits: 8, stopBits: 1, parity: 'none' });

// Write
const writer = port.writable.getWriter();
await writer.write(new TextEncoder().encode('AT\r\n'));
writer.releaseLock();

// Read (stream)
const reader = port.readable.getReader();
while (true) {
  const { value, done } = await reader.read();
  if (done) break;
  console.log(new TextDecoder().decode(value));
}
reader.releaseLock();

await port.close();

see also

implementation reference

Need the exact API surface, compatibility boundaries, errors, lifecycle, and source links? Read the matching gendn reference ↗