Compare CSS Classes Online

Free Online CSS Class Compare Tool

Free online CSS class compare tool. Paste two class lists to see which classes they share and which sit in only one list. Order and repeats are ignored, and the compare runs in the browser, so the classes are never uploaded.

Developer tools by OnlinePCApps since 2013

No upload Shared and unique Order ignored Free
Paste Two Class Lists Here Paste a class attribute or a list of class names into each side. Each list is split into classes on the device, and no copy is sent anywhere. Compare Classes Compared in the browser, nothing leaves this device
0
Bytes uploaded
2
Lists side by side
0
Files stored
$0
Free, always
Why compare class lists

Online CSS Class Compare for Utility Strings and Component States

Two long class strings look almost the same, and the one class that differs is easy to miss. The free online CSS class compare tool lines them up as sets, so shared and odd classes stand out.

Spot the One Class That Differs

Two utility class strings, the kind Tailwind or Bootstrap produce, can run to dozens of tokens. The online CSS class compare tool pulls out the single class one side has and the other lacks, which the eye slides right past.

The one odd class, found fast.

See Shared and Unique at Once

A set comparison answers three questions in one pass: which classes both lists carry, which belong to only the first and which to only the second. The result is grouped, so the overlap and the differences show apart.

Common and unique, side by side.

Diff an Element Across States

A component gains and drops classes as it toggles, opens or errors. Copy the class list from two states, paste both into the online CSS class compare tool and see which classes a state added or removed.

What a state added or removed.
How it works

Compare CSS Classes Online in Three Steps

1

Paste or Upload Two Lists

Paste a class list into Left Class List and another into Right Class List, or select Upload on either side to add a .txt, .css, .md, .jsx, .tsx or .html file. Separate classes with spaces, commas or new lines.

A + B sets common
2

Check the Three Groups

The Class Comparison Breakdown fills in live, so there is no Compare button to select. Every group, Only in Left, In Both (Common) and Only in Right, shows a count. Total Unique sits above them.

3 groups
3

Copy, Search or Swap

Select Copy String on any group to copy its classes, or select one class to copy only that name. Swap Left/Right flips the two lists, Search classes filters all three groups and Clear empties everything.

Three groups Shared and unique
Total Unique One combined count
Two lists One pair at a time
Need it faster?

Desktop CSS Class Compare for Many Files

The online CSS class compare tool takes one pair of lists at a time. Class sets from many files, or a check on every build, fit a short script better.

Get Desktop Version Free trial · Windows 7 to 11
What the free tool does

What the Online CSS Class Compare Tool Does

To compare classes is to treat two lists as sets. The online CSS class compare tool shows where they meet and where they differ.

Split Into Class Tokens

Both lists are split into class names on spaces, commas and new lines. Quote marks are dropped first, so a copied value or a loose list drops straight in.

Shared, Only in Left and Only in Right

In Both (Common) holds the classes both lists carry. Only in Left and Only in Right hold what a list has alone. The three sit apart in the Class Comparison Breakdown, so the overlap and the differences show separately.

Order and Duplicates Ignored

Order makes no difference, and a class written twice counts once. Results list A to Z, so two lists with the same classes in a different arrangement come out as a full match with nothing unique.

Count, Search, Swap and Copy

Total Unique counts every different class across both lists, and every group shows its own count. Search classes filters all three groups, Swap Left/Right flips the lists and Copy String copies a group.

To compare CSS classes, to diff two class lists and to find shared and unique class names all name one task. A search for CSS class compare lands on the online CSS class compare tool above.

Reference

Online CSS Class Compare Results, Case by Case

A comparison checks two class sets and reports where they meet. The cases below show what the tool does and where it stops.

The caseResultWhat happens and why
Inputlist or valueA list of class names on either side, or the value copied from a class attribute.
Separatorsspace, comma, lineSpaces, commas, tabs and new lines all split classes, so any list drops in.
Quote marksdroppedStraight and backtick quote marks are removed before the split.
Class attributeadds class=Pasting the entire attribute leaves a class= token in the result. Paste the value only.
SharedIn Both (Common)The classes both lists carry, the overlap of the two sets.
Only in oneLeft or RightOnly in Left and Only in Right hold the classes a list carries alone.
OrderignoredEvery list is a set, so arrangement makes no difference. Results list A to Z.
Duplicatescounted onceA class written twice in a list counts a single time.
CasesensitiveBtn and btn are two classes. There is no fold-case option, so lowercase both lists first.
Dot prefixkept.btn and btn count as different names. Remove the dots before comparing.
Variantsone tokenhover:bg-blue-500 is a single class name, so it matches only itself.
Stylesnot comparedIt matches names, not what the CSS rules behind them do.
Search classesfiltersFilters all three groups by text, ignoring case.
Copygroup or classCopy String copies a group as a space-separated list. Selecting a class copies that name.
Uploaded fileevery wordUpload accepts .txt, .css, .md, .jsx, .tsx or .html files. Every word in a file becomes a token, so paste class strings, not entire files.
Where it runson the deviceThe lists are compared in the browser, so nothing is uploaded.

How a Class Comparison Works

A class comparison treats every class list as a set rather than a sequence. The online CSS class compare tool splits every side into class names, breaking on spaces, commas and new lines, then drops repeats. From there it is set arithmetic. The intersection, the names present in both sets, is the shared group. The names in the first set but not the second, and those in the second but not the first, form the two unique groups. This is the key difference from a line by line text diff. A text diff cares about order and reports every edit in sequence, which suits a stylesheet checked top to bottom. A class comparison ignores order and answers a different question: which class names two lists have in common and which every holds alone. Two honest limits matter. The tool compares class names, not the CSS rules behind them, so two differently named classes with identical styles still count as different. And class names are case-sensitive, with no fold-case option, so lowercase both lists when case should not count. The references below cover the pieces.

Honest comparison

Online CSS Class Compare vs a Text Diff

Both compare two inputs. The split is a set of names against a line by line diff that keeps order.

Point of comparison This tool Online class compare On the device A text diff A line by line tool
How it compares As a set of class names Line by line, in order
Price and caps Free with no sign-up Free tier often capped
Does order matter Order ignored, sets only Reorder shows as a difference
Grouped result Shared and unique groups Added and removed lines
An entire stylesheet Only two class lists Every line of a file

A text diff wins for an entire file checked in order, like a stylesheet or a script where every changed line matters. The online CSS class compare tool wins for two class lists where order is irrelevant and the question is which names they share. Online file tools and whether yours uploads goes deeper on where pasted markup goes.

Why no upload

Online CSS Class Compare Privacy and Data Handling

Both lists are split and compared inside the browser, so the work is client-side and the classes stay on the machine that entered them. No copy is passed to a server for the job.

Markup pasted to compare often comes from unreleased work, a private component or an internal tool never meant for an outside server. A hosted tool would upload it to compare, far more exposure than checking two class lists is worth.

1. Open the browser tools at the Network tab
2. Clear the log and let it record
3. Compare two lists with the panel above
→ Nothing uploads. The lists were compared on the page itself.
0
Bytes uploaded
0
Files stored
0
Accounts required
0
Watermarks added
Alternatives

Online CSS Class Compare Alternatives

All of these compare two sets of classes. They differ in setup, in what they report and in effort.

A Text Diff

A diff tool compares two blocks line by line in order.
It suits an entire file checked top to bottom.
Limit: Reordering counts as a difference.

A Short Script

A few lines with a Set gives the intersection and differences.
It fits a repeated or scripted check.
Limit: Needs a script written and run.

Browser DevTools

The console lists an element classList to inspect its classes.
It works on a live element in the page.
Limit: Comparing two elements is fiddly.

By Eye

Reading two strings across works for a handful of classes.
It needs no tool at all for a short list.
Limit: A long string hides the odd class.

A diff, a script, the console and the naked eye all compare classes, yet every one keeps order, needs code or strains on a long list. The online CSS class compare tool groups two lists as sets with nothing to set up.

Before comparing

Three Things to Know Before Using an Online CSS Class Compare Tool

Keep these in mind for a clearer result.

It Is a Set, Not a Diff

Every list counts as a set, so order and repeats do not count. For a comparison that keeps order and reports every changed line, a text diff is the fit. This tool answers which class names two lists share and which every holds alone.

Names, Not the Styles

The comparison is on the class names, not on what the CSS rules behind them do. Two classes with different names but identical styles still count as different, since the tool never resolves the stylesheet, only the list of names.

Watch the Case

Class names are case-sensitive, so Btn and btn count as two classes. There is no fold-case option on this page, so lowercase both lists first when case should not count.

The desktop edition

Desktop CSS Class Compare for a Full Project

The online CSS class compare tool takes two lists at once, which fits the pair in hand. Class sets from many components, or a check on every build, belong on a short script or a CSS tool that opens files from disk.

On this pagetwo lists at a time
A scriptclass sets across a project
Sets Across Files

A script gathers the class names used across many components and compares the sets, so shared and stray classes surface project-wide.

Unused Classes

A CSS checker matches the classes a stylesheet defines against those the markup uses, so classes defined but never applied are flagged.

A Build Check

A step in the build compares class sets and can fail when an expected class goes missing, so a drift is caught before it ships.

Common questions

Online CSS Class Compare Questions

Paste a class list into Left Class List and another into Right Class List. The tool splits every into class names and compares them as sets. The Class Comparison Breakdown shows Only in Left, In Both (Common) and Only in Right, with a count on every group. It updates live.
Paste or upload two lists, then check the three groups. There is no Compare button to select. Use Swap Left/Right if you pasted them the wrong way round, and Clear to empty both lists and start over.
No. Both lists are split and compared in the browser, so the classes never leave the device. Markup pasted to compare often comes from unreleased work or an internal component that has no business on an outside server.
A text diff compares line by line and keeps order, which suits an entire file. This tool treats every list as a set and ignores order, so you see which class names two lists share and which every holds alone. For a file, use the online text diff. To confirm two files match byte for byte, use the online hash generator.
No. Every list counts as a set, so the arrangement of your classes makes no difference. Two lists with the same class names in a different order come out as a full match, with In Both (Common) holding everything and nothing unique. Results list A to Z.
A class written more than once in a list counts a single time, since a set holds every name once. A repeat in your left list never shows up as a difference against the right one.
Yes. Btn and btn count as two classes, and there is no fold-case option on this page. If case should not count, lowercase both lists first. The online JS beautifier can tidy a minified stylesheet before you copy class names out of it.
No. It compares class names, not what the CSS rules behind them do. Two classes with different names but identical styles still count as different, since the tool never resolves your stylesheet.
Spaces, commas, tabs and new lines all work. A list copied from an element, a comma-separated list or a column of names split cleanly into class tokens, and straight and backtick quote marks are dropped before the split.
Paste the value only. If you paste the entire attribute, the quote marks are dropped and class= stays as a token, so it shows up as a class in the result. Copy only what sits between the quote marks to keep the groups clean.
Yes, that is a common use. A utility string can run to dozens of tokens, and comparing two as sets pulls out the one class a side gained or lost. Variants like hover:bg-blue-500 are one token, so they match only an identical class.
In the online CSS class compare tool, In Both (Common) holds the classes both lists carry. Only in Left and Only in Right hold the classes a list has alone. Total Unique counts every different class across both lists, so shared classes count once.
Yes. Select Copy String on any group to copy its classes as one space-separated list, or select a single class to copy only that name. The two inputs stay as they are, so you can edit a list and compare again.
Yes. Type in Search classes and all three groups filter at once, ignoring case. A group with no hits says No matching classes found, and an empty group says None.
Yes. Select Upload on either panel and add a .txt, .css, .md, .jsx, .tsx or .html file. Its text lands in the panel, but every word becomes a token, so paste only class strings from large files. To pull class names out of markup first, use the online regex tester. If characters look broken, Character encoding explained and why text arrives broken explains why, and CRLF vs LF and the two bytes that break things covers line breaks.
The tool compares two lists at a time, which covers the usual check of one against another. For class sets gathered across many files, use a short script with a set operation. If your lists sit in a JSON export, tidy it first with the online JSON formatter.
Yes. It runs in a mobile browser as well as on a desktop, so you can compare two class lists on your phone without an app. The split and the comparison happen on the device, and nothing is sent to a server.
Yes. A static page costs little to serve, and since the comparison runs on the device nothing is received or stored here. The wider set of tools funds the site. This one has no cap, no watermark and no account to make.

OnlinePCApps Developer Group

Written and reviewed by Simon Falk, who has worked on front-end tooling and developer tools here since 2013

Last reviewed October 2026
13
Years on dev tools
0
Lists uploaded
3
Result groups
0
Watermarks

The reason a class comparison is its own tool, rather than a job for a text diff, comes down to what a class list is. It is a set, not a sequence. The browser treats the class attribute as an unordered collection of tokens, so two elements with the same classes in a different order are styled the same. A diff that flags the reordering as an edit answers the wrong question. The online CSS class compare tool leans into that. It splits every side into class names, drops repeats, treats the two as sets and reports the intersection as the shared group and the two leftovers as the unique groups. That framing makes a long utility string manageable, since the one class that differs surfaces instead of hiding in a wall of tokens. Three honest limits stay in view. The comparison is on names, not the styles behind them. Class names are case-sensitive and there is no fold-case option. A pasted class attribute adds a class= token, so paste the value only. Since pasted markup is often private, the compare runs in the browser and sends nothing to a server.

Standards followed

Set · Intersection Order · Ignored Names · Not Styles classList · Tokens
Built on the same shared design system as every OnlinePCApps tool. onlinepcapps.com

Compare CSS Classes Online for Free

No sign-up needed. Paste two lists into the online CSS class compare tool and the groups appear live.

Compare Classes Free, no account Try Desktop Edition For many files, use a script
Compare Classes