<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/how-to-detect-unused-css-or-javascript-nztji1xfh" -->

---
title: How to Detect Unused CSS or JavaScript | daily.dev
description: Chrome DevTools is a powerful tool provided by Google. It can be used to help developers refactor large code bases. The tool can also be used by developers who...
canonical: https://daily.dev/posts/how-to-detect-unused-css-or-javascript-nztji1xfh
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: How to Detect Unused CSS or JavaScript | daily.dev
og:description: Chrome DevTools is a powerful tool provided by Google. It can be used to help developers refactor large code bases. The tool can also be used by developers who...
og:url: https://daily.dev/posts/how-to-detect-unused-css-or-javascript-nztji1xfh
og:image: https://api.daily.dev/og/posts/NZtji1XfH.png
og:image:alt: How to Detect Unused CSS or JavaScript
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Detect Unused CSS or JavaScript

**[JavaScript in Plain English](https://daily.dev/sources/jsPlainEnglish)** · [@codewithakash](https://daily.dev/codewithakash) · 1 min read · 55 upvotes · 8 comments

## Summary

Chrome DevTools is a powerful tool provided by Google. It can be used to help developers refactor large code bases. The tool can also be used by developers who have been working on the same codebase for a long time or who are new to the team. To use the tool, right click and inspecting using ‘Inspect’

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://javascript.plainenglish.io/detect-unused-css-or-javascript-in-your-code-8d200ef07e50>

## Community discussion

Top comments from developers on daily.dev.

**@charlibydesign** · 2 upvotes

> This is very interesting. While at this time I'm not versed in JavaScript enough to need to use this for that, I can definitely use it for CSS files.

**@sdp971** · 1 upvotes

> Thank you so much ! Very helpful ! Exactly what I was looking for

**@rafamaths** · 1 upvotes

> Amazing! Congratulations for article.

**@pavlicko** · 1 upvotes

> thumbs up! had no idea this existed - i love the fact that it color codes the used section of code in the source view :)

---

Tags: [#css](https://daily.dev/tags/css), [#general-programming](https://daily.dev/tags/general-programming), [#google-chrome](https://daily.dev/tags/google-chrome), [#javascript](https://daily.dev/tags/javascript)

[View this post on daily.dev](https://daily.dev/posts/how-to-detect-unused-css-or-javascript-nztji1xfh)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"How to Detect Unused CSS or JavaScript","url":"https://daily.dev/posts/how-to-detect-unused-css-or-javascript-nztji1xfh","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/how-to-detect-unused-css-or-javascript-nztji1xfh"},"datePublished":"2021-06-20T14:12:05.191Z","dateModified":"2026-03-15T04:30:49.552Z","description":"Chrome DevTools is a powerful tool provided by Google. It can be used to help developers refactor large code bases. The tool can also be used by developers who...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/cd851ff26c9b7e37f91db289d2b5410a","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/cd851ff26c9b7e37f91db289d2b5410a","isAccessibleForFree":true,"articleSection":"JavaScript in Plain English","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Akash Kriplani","url":"https://daily.dev/codewithakash","image":"https://lh3.googleusercontent.com/a-/AOh14GjEtbuTV8bfHOSaefkBbbKXjz5FOmRoHWyWO1PjUg=s100","description":"Front end developer","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":70}},"commentCount":8,"discussionUrl":"https://daily.dev/posts/how-to-detect-unused-css-or-javascript-nztji1xfh","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":55},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":8}],"keywords":"css,general-programming,google-chrome,javascript","timeRequired":"PT1M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"JavaScript in Plain English","item":"https://daily.dev/sources/jsPlainEnglish"},{"@type":"ListItem","position":3,"name":"How to Detect Unused CSS or JavaScript"}]}
{"@context":"https://schema.org","@type":"WebPage","@id":"https://daily.dev/posts/how-to-detect-unused-css-or-javascript-nztji1xfh","comment":[{"@type":"Comment","text":"This is very interesting. While at this time I’m not versed in JavaScript enough to need to use this for that, I can definitely use it for CSS files.","datePublished":"2021-06-23T06:09:36.958Z","url":"https://daily.dev/posts/NZtji1XfH#c-BVSl4g7FR","author":{"@type":"Person","name":"Charli by Design","url":"https://daily.dev/charlibydesign","image":"https://avatars2.githubusercontent.com/u/51497813?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}},{"@type":"Comment","text":"Thank you so much ! Very helpful ! Exactly what I was looking for","datePublished":"2021-06-25T06:53:12.326Z","url":"https://daily.dev/posts/NZtji1XfH#c-HTg2ZQPSM","author":{"@type":"Person","name":"Séverine DORIMOND PEREIRA","url":"https://daily.dev/sdp971","image":"https://avatars3.githubusercontent.com/u/76818441?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"Amazing! Congratulations for article.","datePublished":"2021-06-20T23:37:54.727Z","url":"https://daily.dev/posts/NZtji1XfH#c-TmTI_9rsN","author":{"@type":"Person","name":"Rafael Silva Galdino Mathias","url":"https://daily.dev/rafamaths","image":"https://avatars.githubusercontent.com/u/76234176?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}},{"@type":"Comment","text":"thumbs up! had no idea this existed - i love the fact that it color codes the used section of code in the source view :)","datePublished":"2021-06-21T20:55:17.597Z","url":"https://daily.dev/posts/NZtji1XfH#c-GXK1ZD7ZA","author":{"@type":"Person","name":"David Pavlicko","url":"https://daily.dev/pavlicko","image":"https://avatars.githubusercontent.com/u/5881821?v=4"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1}}]}
```

