The Simple-Talk Code Prettifier
- for SQL Server, Python, VB and C#
This utility is designed for people wanting to paste code into blogs, Wikis, forums or articles
it takes ASCII source code and
  • substitutes HTML entities for all non-ascii characters and HTML reserved characters
  • It colour-codes the code according to the standard style
  • It substitutes hard spaces for tabs
  • it optionally converts all Keywords to upper case
Paste your code in the Code window, and the results are rendered in the 'Rendered' window. The code itself is in the 'Source HTML' window. you can click between the windows using the Tabs.
Style of HTML Best - Use SPANs and CODE
Forums - Use FONTs and PRE
WIKIs - Use Spans and TTs
IFcodes (eg. SSC Forum)
XHTML 1.1 (spans & classes)
Keywords Correct Case   Leave alone
Language TSQL   VB     C#     Python
Indenting Correct indenting;  Leave alone
Tab-Length   spaces per tab position
Source CodeRendered HTML Source HTML

For more flexible code layout functionality from within SQL Server Management Studio or Visual Studio, download Red Gate SQL Prompt.