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.

It uses Black: the uncompromising Python code formatter.

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.

Load Python file From URL