How to use this developer tool
- Paste Python code.
- Choose one conversion mode.
- Enter the target Python version.
- Run the conversion and review the safety note.
- Copy or download the converted code.
Convert Python formatting conventions and selected syntax patterns directly in the browser. Choose safe whitespace conversions or preview version-sensitive changes such as print statements and f-strings without sending source code to a server.
It separates safe formatting conversions from syntax rewrites that may change behavior. Version-sensitive conversions are labeled for manual review.
Quote, f-string, and syntax conversions can be semantically unsafe. Preview and test converted code before use.
print "Hello, %s" % name
print(f"Hello, {name}")Choose Percent Formatting to f-string Preview and review each replacement before using it.
Choose Tabs to 4 Spaces and run the converter.
Choose Line Endings to LF. The content remains unchanged apart from newline characters.
Yes, the naming conversion scans identifier-like tokens while avoiding quoted strings.
Choose Python 2 Print to Python 3 and then test the result under Python 3.
| Safe | Tabs and line endings |
|---|---|
| Review | Quotes and identifiers |
| Potentially breaking | Syntax rewrites |
| Output | .py |