Adding this line "plugins": ["prettier-plugin-tailwindcss"], to my .prettierrc.json file made the tailwind class sorting work for me. I'm using prettier 3.1.0 and prettier-plugin-tailwindcss 0.5.7

Answer from DeepThunder on Stack Overflow
🌐
GitHub
github.com › tailwindlabs › prettier-plugin-tailwindcss
GitHub - tailwindlabs/prettier-plugin-tailwindcss: A Prettier plugin for Tailwind CSS that automatically sorts classes based on our recommended class order. · GitHub
A Prettier plugin for Tailwind CSS that automatically sorts classes based on our recommended class order. - tailwindlabs/prettier-plugin-tailwindcss
Author   tailwindlabs
🌐
Tailwind CSS
tailwindcss.com › blog › automatic-class-sorting-with-prettier
Automatic Class Sorting with Prettier - Tailwind CSS
People have been talking about the best way to sort your utility classes in Tailwind projects for at least four years. Today we're excited to announce that you can finally stop worrying about it with the release of our official Prettier plugin for Tailwind CSS.
Discussions

visual studio code - prettier-tailwind-plugin isn't working as expected when I hit save in VSCode - Stack Overflow
I installed the prettier-plugin-tailwindcss and it successfully sorts the Tailwind classes when I run Prettier using npx prettier --write index.html. However, when I hit save in VScode, the prettier- More on stackoverflow.com
🌐 stackoverflow.com
I spent over two hours trying to get Prettier to work with prettier-plugin-tailwindcss. Anyone here using it?
Search files prettierrc and tailwind config files on github for sur you ll have the right settings from there More on reddit.com
🌐 r/tailwindcss
16
7
July 7, 2023
Lost trying to get prettier-plugin-tailwindcss working
I’m new to Sage 10 so forgive me If I am missing something glaring. I cannot seem to get prettier for tailwindcss working. I have installed the plugins: npm install -D prettier prettier-plugin-tailwindcss I have upda… More on discourse.roots.io
🌐 discourse.roots.io
0
October 22, 2022
[Prettier Plugin]
I've got a project using Astro. I have prettier 3.5.3 set up and it's working as expected on .astro files for TS and HTML formatting. I'd like to use the prettier-plugin-tailwindcss to ... More on github.com
🌐 github.com
3
1
🌐
npm
npmjs.com › package › prettier-plugin-tailwind-css
prettier-plugin-tailwind-css - npm
It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary. This plugin adds support for the Tailwind CSS library.
      » npm install prettier-plugin-tailwind-css
    
🌐
Roots Discourse
discourse.roots.io › sage
Lost trying to get prettier-plugin-tailwindcss working - sage - Roots Discourse
October 22, 2022 - I’m new to Sage 10 so forgive me If I am missing something glaring. I cannot seem to get prettier for tailwindcss working. I have installed the plugins: npm install -D prettier prettier-plugin-tailwindcss I have updated my tailwind.config.cjs plugins: [ require("prettier-plugin-tailwindcss"), require("@tailwindcss/aspect-ratio"), ], bud development compiles without error but classes are not getting sorted.
Find elsewhere
🌐
Tailwind CSS
tailwindcss.com › blog › 2024-05-30-prettier-plugin-collapse-whitespace
Automatically clean up whitespace and duplicate class names - Tailwind CSS
May 31, 2024 - We just released a new version of prettier-plugin-tailwindcss which adds support for removing unnecessary whitespace and duplicate classes when sorting.
🌐
Tailwind CSS
tailwindcss.com › docs › editor-setup
Editor setup - Getting started - Tailwind CSS
It has built-in support for Tailwind CSS autocompletions, linting, and hover previews, without the need to install and configure a separate extension. It also integrates tightly with Prettier, so our official Prettier plugin works seamlessly with Zed when installed.
🌐
Tessl
tessl.io › registry › tessl › npm-prettier-plugin-tailwindcss › 0.6.0
tessl/npm-prettier-plugin-tailwindcss@0.6.x - Registry - Tessl
September 15, 2025 - pkg:npm/prettier-plugin-tailwi... · Prettier Plugin Tailwind CSS is a Prettier v3+ plugin that automatically sorts Tailwind CSS classes based on the recommended class order....
🌐
Francisco Moretti
franciscomoretti.com › blog › how-to-setup-tailwind-and-sort-imports-prettier-plugins
How to Setup Tailwind and Sort Imports Prettier Plugins
June 26, 2023 - The prettier-plugin-tailwindcss plugin is specifically designed to work with Tailwind CSS. It allows you to format your Tailwind CSS classes using Prettier's powerful formatting capabilities.
🌐
Web Reaper
webreaper.dev › posts › astro-prettier-tailwind-setup
Setup Astro 3.0 with Tailwind CSS Prettier Plugin
September 9, 2023 - Save time and eliminate styling discussion with auto-formatting and tailwind auto-class-ordering on save by setting up Prettier for Tailwind CSS in your Astro 3.0 projects.
🌐
npm
npmjs.com › package › prettier-plugin-tailwindcss › v › 0.1.1
prettier-plugin-tailwindcss - npm
A Prettier plugin for sorting Tailwind CSS classes.. Latest version: 0.7.2, last published: 9 days ago. Start using prettier-plugin-tailwindcss in your project by running `npm i prettier-plugin-tailwindcss`. There are 603 other projects in the ...
      » npm install prettier-plugin-tailwindcss
    
Published   Dec 01, 2025
Version   0.1.1
🌐
Straffesites
straffesites.com › en › blog › integrate prettier astro tailwindcss
Integrate Prettier with Astro & Tailwind CSS for Cleaner Code - Straffe Sites
December 4, 2024 - npx astro add tailwindcss npm install prettier prettier-plugin-astro prettier-plugin-tailwindcss
🌐
Medium
medium.com › @alldofaiz › automatically-sort-tailwind-css-classes-in-next-js-with-prettier-d1678d8fe7ae
🛠 Automatically Sort Tailwind CSS Classes in Next.js with Prettier | by Alldofaiz | Medium
July 23, 2025 - In this article, I’ll show you how to automatically sort Tailwind CSS classes in your Next.js project using Prettier and the official plugin prettier-plugin-tailwindcss.
🌐
CodeSandbox
codesandbox.io › examples › package › prettier-plugin-tailwind-css
prettier-plugin-tailwind-css examples - CodeSandbox
Use this online prettier-plugin-tailwind-css playground to view and fork prettier-plugin-tailwind-css example apps and templates on CodeSandbox.
🌐
jsDelivr
jsdelivr.com › package › npm › prettier-plugin-tailwindcss-extra-plus
prettier-plugin-tailwindcss-extra-plus CDN by jsDelivr - A CDN for npm and GitHub
February 18, 2025 - A free, fast, and reliable CDN for prettier-plugin-tailwindcss-extra-plus. Adds Tailwind class sorting to a set of languages that are not yet supported by prettier
Published   Aug 05, 2024
🌐
GitHub
github.com › tailwindlabs › prettier-plugin-tailwindcss › releases
Releases · tailwindlabs/prettier-plugin-tailwindcss
A Prettier plugin for Tailwind CSS that automatically sorts classes based on our recommended class order. - tailwindlabs/prettier-plugin-tailwindcss
Author   tailwindlabs
🌐
GitHub
github.com › tailwindlabs › prettier-plugin-tailwindcss › issues › 113
prettier-plugin-tailwindcss doesn't work with vscode · Issue #113 · tailwindlabs/prettier-plugin-tailwindcss
November 30, 2022 - Describe your issue prettier-plugin-tailwindcss doesn't work with vscode and it's plugin Svelte for VS Code and Prettier - Code formatter; it won't format the *.svelte files (but it formats the html files);
Published   Dec 31, 2022
🌐
DEV Community
dev.to › iamsheye › how-to-setup-tailwind-css-automatic-class-sorting-with-prettier-in-new-and-existing-projects-2ob8
How to Setup Tailwind CSS Automatic Class Sorting with Prettier in New and Existing Projects - DEV Community
August 1, 2024 - By leveraging tools like Prettier along with plugins such as prettier-plugin-tailwindcss, we can automate the sorting of Tailwind CSS classes, ensuring a consistent order and improving the readability and maintainability of classes.