WP Code Preview

Preview your source code with syntax highlighting before you post to your WordPress site.
Tweak the many settings to get it just right and then copy/paste it into your blog post.
Check out our how-to page for more info.

1. Enter your code:
Edit your code in the box above and it will appear below nicely formatted below.
2. Check how it looks when formatted:
            // code here
            String s = new String();
3. Set the options and check the results above:
Choose the correct language syntax required for your code (mandatory).
Makes all URLs in your source code clickable.
Code will load as a collapsed box requiring the user to click to expand it.
Set a label for your code block, useful when combined with the collapsed mode.
Leaner view with no line numbers or margins (useful if only a few lines of code).
Highlights HTML/XML which is useful if mixing code into HTML (e.g. PHP inside of HTML).
Displays line numbering on the left hand side of the code.
Set the number that the line numbering starts at (defaults to 1).
List the line numbers to be highlighted (e.g. “5,8,34”).
Control line number padding. If 'custom' enter the value below.
If 'custom' padding chosen enter a number to force padding (e.g. 4 = 0001).
4. Copy the generated shortcode with your code (or choose to just copy the shortcode):
5. Paste it into your WordPress post editor of choice (see user guide).
6. All done! Got another code snippet - reset and go again:

For more help check out the User Guide