Why Do I Get Garbage Characters in Serial Monitor?

Almost always the baud rate in Serial Monitor does not match the baud rate in your code.

Fix it fast

  1. Check your code for Serial.begin(9600);.
  2. Set Serial Monitor to the same number.
  3. Close and reopen Serial Monitor.

Other causes

  • Wrong board selected in the IDE.
  • Noise on long wires.
  • Using SoftwareSerial with the wrong pins.
Bottom line

Match the baud rate and most garbage output disappears.

Related: How do I use Serial Monitor correctly? · Why does my code compile but not work? · What does this error message mean?