Online GDB Pro

Tutorial · Python debugger

How to debug Python online

To debug Python online, paste your script into Online GDB Pro, choose Python, click the line numbers where you want to stop and press Debug. You can then step line by line, enter and leave functions, see every variable and return value, and go back when you step too far.

Debug Python now

In short

  • Python runs on CPython 3.13 in your browser, with the standard library.
  • Breakpoints stop before a line runs; Next, Step and Finish work as in pdb and GDB.
  • The Variables panel shows locals with their types, for each frame of the call stack.
  • When a function returns, the debugger shows the value it returned.
  • An exception stops at the line that raised it, with the traceback.

Step by step

  1. Choose Python and paste your code Select Python in the IDE and paste your script. If it calls input(), type the answers in the Input box, one per line.
  2. Click line numbers for breakpoints Click the number next to a line to stop there. You can also type break 8 in the console.
  3. Press Debug The script runs to the first breakpoint. With no breakpoint, it stops on the first line.
  4. Step through Next runs the line, Step enters a function you call, Finish runs to the end of the current function and Continue runs to the next breakpoint.
  5. Read the variables Lists, dicts, objects and strings show their contents. Values that changed on the last step are highlighted; click a frame in the call stack to see its own variables.

When your script raises an error

Run shows the traceback just like python main.py does, and the editor marks the failing line. Debug the same script to stop before that line and inspect the values that caused the error, then use reverse-step to see how they got there.

Compared with pdb

Python’s built-in debugger, pdb, uses the same ideas: break, next, step, continue and p. Online GDB Pro shows them as buttons and panels and records the run, so you can also step backwards. Programs run with the standard library; packages that need to be installed with pip are not available.

Frequently asked questions

Which Python version is used?

Python 3.13 (CPython compiled to WebAssembly by Pyodide), with the standard library.

Can I use input() while debugging?

Yes. input() reads the lines you typed in the Input box, in order. The prompt text appears in the output.

Why does the debugger stop on a step limit?

The debugger records up to 20,000 line steps (300,000 with VIP). A long loop or an infinite loop reaches it; step back from the end to see where the loop repeats.

Is Online GDB Pro free?

Yes. Running, debugging and the lessons are free with no sign-up. VIP removes ads and raises the run-time and debugger limits.

Is my code uploaded to a server?

No. Online GDB Pro compiles and runs your program in your browser, on your own device.

Sources

Updated 2026-11-28. Online GDB Pro is an independent tool. It is not affiliated with, endorsed by or sponsored by the GNU Project, the Free Software Foundation or OnlineGDB. GDB is a GNU Project debugger.