Python formatter


Python version for formatter

This Online Python formatter allows to easily format unformatted or ugly Python code.

This Python beautifier supports these versions: 2.7, 3.3, 3.4, 3.5, 3.6, 3.7 and 3.8.

User guide

How to format Python code Online?

  • Fill Python editor:

    In order to fill the Python editor, you can:

    • Copy and paste your Python string.
    • Drag and drop your Python file.
    • Directly type your code in the editor.
    • Browse your Python file (Clicks on "Browse" button).
    • Retrieve your Python file from a URL(Clicks on "Load Python from URL" button).
      The URL must be secure ("https") and CORS must be enabled otherwise the file will not be downloaded.
  • Format Python code:

    You can format Python code by clicking on the button "Format".

You can click on "Copy to clipboard" button to copy the formatted Python code to the clipboard.

You can also click on "Download" button in order to download the formatted Python code.

Why use code formatters for Python?

We rarely code alone, it is possible that other developers review your code. In this case, you must adhering to a style guide for writing code. This allows to clean and improve readability of the code, and making contributions and code reviews easier.

The most popular Python formatters are: Black, YAPF, isort, autopep8, ...

This tool uses Black: the uncompromising Python code formatter (MIT License).
Black is a PEP 8 compliant opinionated formatter. Note: This beautifier are few options.

Extendsclass has other Python tools you may be interested in: Python validator, Python playground.

If you have ideas for interesting features, do not hesitate to send me a message to present it to me.

Load Python file From URL