DEVDESK / GUIDE
Code Formatter — Usage guide
View and format C, C#, C++, CSS, Go, HTML, Java, JavaScript, Perl, PHP, Python, Ruby, SQL, and TypeScript with syntax highlighting and selectable themes. Editing, formatting, and image export run in your browser.
How to use it
- Choose a language, color theme, and 2- or 4-space indentation.
- Paste code or load an example, then format it.
- Copy the result or save a syntax-highlighted PNG image.
Input and output examples
Example 1
Input
class Hello{public static void main(String[] args){System.out.println("Hello, DevDesk!");}}Output
class Hello {
public static void main(String[] args) {
System.out.println("Hello, DevDesk!");
}
}Example 2
Input
function greet(name){return "Hello, "+name+"!"}Output
function greet(name) {
return "Hello, " + name + "!";
}Frequently asked questions
Is my code sent to a server?
No. Editing and formatting run in your browser, and input code is not sent to a server.
Can every language be formatted automatically?
Formatting is available for all 14 listed languages. Perl uses syntax structure for line breaks and indentation, while Go follows gofmt indentation.
Can I save the result as an image?
Yes. Save the formatted result as a PNG with the selected color theme and syntax highlighting.