What’s changed?

Historically, users on GitHub have been able to set their preferred tab width for viewing code, but this preference was not reliably respected throughout the site. Inconsistent tab rendering, especially in Markdown-rendered content (i.e., READMEs and discussions) led to code that looked different from what users expected. This made it harder to read and review. This also meant that project-defined tab widths weren’t always applied, further impacting the overall developer experience.

GitHub now applies user-defined tab width preferences consistently across the entire site. A global CSS update ensures that anywhere code is displayed, whether it’s in preformatted text, code blocks, or other Markdown-rendered contexts, the tab size will match the user’s setting from their account preferences. It’s important to note that this improvement only affects code that uses tab characters; code indented with spaces will continue to appear as before. The main impact will be seen in places like READMEs and discussions where Markdown content includes code blocks. This enables a more uniform and personalized code-viewing experience across GitHub.

We’d love your feedback!

Your feedback is essential as we continue to refine and improve code presentation on GitHub. If you notice any places where your tab width preference is not respected, or if you have suggestions for further improvements, join the discussion within the GitHub Community.