{"id":655,"date":"2025-05-03T15:26:32","date_gmt":"2025-05-03T15:26:32","guid":{"rendered":"https:\/\/websiteship.com\/?p=655"},"modified":"2025-11-30T13:28:25","modified_gmt":"2025-11-30T13:28:25","slug":"word-counter","status":"publish","type":"tool","link":"https:\/\/tutorialsclass.com\/tool\/word-counter\/","title":{"rendered":"Word Counter"},"content":{"rendered":"\n<p>Paste or type your content and get an instant word count along with other useful information. Helpful for writing, blogging, and meeting content length requirements.<\/p>\n\n\n<div id=\"wss-text-analyzer\" class=\"\">\r\n\r\n\t<div class=\"row\">\r\n\t\t<!-- Textarea (8 columns) -->\r\n\t\t<div class=\"col-sm-7 col-md-8 col-8\">\r\n\t\t\t\t<div class=\"box-header\">\r\n\t\t\t\t\t<h4>Enter your text below:<\/h4>\r\n\t\t\t\t<\/div>\r\n\t\t\t\t<div class=\"box-circle\">\r\n\t\t\t\t\t<textarea id=\"textInput\" class=\"form-control\" placeholder=\"Start typing or Paste your content here...\"><\/textarea>\r\n\t\t\t\t<\/div>\r\n\r\n\t\t\t\t<div class=\"alert alert-warning mt-3\" role=\"alert\">\r\n\t\t\t\t\t<strong>Note:<\/strong> The counts will update automatically whenever you type, paste, or modify content.\r\n\t\t\t\t<\/div>\r\n\t\t<\/div>\r\n\r\n\t\t<!-- Result Stats (4 columns) -->\r\n\t\t<div class=\"col-sm-5 col-md-4 col-8\">\r\n\t\t\t<div class=\"stat-card\">\r\n\t\t\t\t<h4 class=\"mb-3\">Text Statistics<\/h4>\r\n\r\n\t\t\t\t<div class=\"d-flex flex-column\">\r\n                    <div class=\"stat-box\"><strong>Characters (with spaces):<\/strong> <span id=\"charWithSpaces\" class=\"float-right count-text\">0<\/span><\/div>\r\n                    <div class=\"stat-box\"><strong>Characters (without spaces):<\/strong> <span id=\"charNoSpaces\" class=\"float-right count-text\">0<\/span><\/div>\r\n                    <div class=\"stat-box\"><strong>Words:<\/strong> <span id=\"wordCount\" class=\"float-right count-text\">0<\/span><\/div>\r\n                    <div class=\"stat-box\"><strong>Paragraphs:<\/strong> <span id=\"paraCount\" class=\"float-right count-text\">0<\/span><\/div>\r\n                    <div class=\"stat-box\"><strong>Lines:<\/strong> <span id=\"lineCount\" class=\"float-right count-text\">0<\/span><\/div>\r\n                    <div class=\"stat-box\"><strong>Spaces:<\/strong> <span id=\"spaceCount\" class=\"float-right count-text\">0<\/span><\/div>\r\n                    <div class=\"stat-box mb-4\"><strong>Sentences:<\/strong> <span id=\"sentenceCount\" class=\"float-right count-text\">0<\/span><\/div>\r\n\t\t\t\t<\/div>\r\n\r\n\t\t\t\t<h5 class=\"mt-3 mb-2\">Top 10 Keywords<\/h5>\r\n\t\t\t\t<table class=\"table table-bordered table-sm keyword-table\">\r\n\t\t\t\t\t<thead>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<th>Keyword<\/th>\r\n\t\t\t\t\t\t<th>Count<\/th>\r\n\t\t\t\t\t\t<th>Density<\/th>\r\n\t\t\t\t\t<\/tr>\r\n\t\t\t\t\t<\/thead>\r\n\t\t\t\t\t<tbody id=\"keywordTableBody\">\r\n\t\t\t\t\t<tr><td colspan=\"3\" class=\"text-center\">No data<\/td><\/tr>\r\n\t\t\t\t\t<\/tbody>\r\n\t\t\t\t<\/table>\r\n\t\t\t<\/div>\r\n\t\t<\/div>\r\n\t<\/div>\r\n\t\r\n\r\n<\/div>\r\n\r\n\r\n\r\n<script>\r\n    const textInput = document.getElementById(\"textInput\");\r\n\r\n    const stopwords = new Set([\r\n        \"a\", \"about\", \"above\", \"after\", \"again\", \"against\", \"all\", \"am\", \"an\", \"and\",\r\n        \"any\", \"are\", \"as\", \"at\", \"be\", \"because\", \"been\", \"before\", \"being\", \"below\",\r\n        \"between\", \"both\", \"but\", \"by\", \"could\", \"did\", \"do\", \"does\", \"doing\", \"down\",\r\n        \"during\", \"each\", \"few\", \"for\", \"from\", \"further\", \"had\", \"has\", \"have\", \"having\",\r\n        \"he\", \"her\", \"here\", \"hers\", \"herself\", \"him\", \"himself\", \"his\", \"how\", \"i\", \"if\",\r\n        \"in\", \"into\", \"is\", \"it\", \"its\", \"itself\", \"just\", \"me\", \"more\", \"most\", \"my\",\r\n        \"myself\", \"no\", \"nor\", \"not\", \"now\", \"of\", \"off\", \"on\", \"once\", \"only\", \"or\",\r\n        \"other\", \"our\", \"ours\", \"ourselves\", \"out\", \"over\", \"own\", \"same\", \"she\", \"should\",\r\n        \"so\", \"some\", \"such\", \"than\", \"that\", \"the\", \"their\", \"theirs\", \"them\",\r\n        \"themselves\", \"then\", \"there\", \"these\", \"they\", \"this\", \"those\", \"through\", \"to\",\r\n        \"too\", \"under\", \"until\", \"up\", \"very\", \"was\", \"we\", \"were\", \"what\", \"when\", \"where\",\r\n        \"which\", \"while\", \"who\", \"whom\", \"why\", \"will\", \"with\", \"you\", \"your\", \"yours\",\r\n        \"yourself\", \"yourselves\"\r\n    ]);\r\n\r\n    function analyzeText(text) {\r\n        const charWithSpaces = text.length;\r\n        const charNoSpaces = text.replace(\/\\s\/g, \"\").length;\r\n        const words = text.trim().match(\/\\b\\w+\\b\/g) || [];\r\n        const wordCount = words.length;\r\n        const lineCount = text.split(\/\\r\\n|\\r|\\n\/).length;\r\n        const spaceCount = (text.match(\/ \/g) || []).length;\r\n        const paraCount = text.trim() === \"\" ? 0 : text.trim().split(\/\\n{2,}\/).length;\r\n        const sentenceCount = (text.match(\/[^.!?]+[.!?]\/g) || []).length;\r\n\r\n        document.getElementById(\"charWithSpaces\").innerText = charWithSpaces;\r\n        document.getElementById(\"charNoSpaces\").innerText = charNoSpaces;\r\n        document.getElementById(\"wordCount\").innerText = wordCount;\r\n        document.getElementById(\"lineCount\").innerText = lineCount;\r\n        document.getElementById(\"spaceCount\").innerText = spaceCount;\r\n        document.getElementById(\"paraCount\").innerText = paraCount;\r\n        document.getElementById(\"sentenceCount\").innerText = sentenceCount;\r\n\r\n        \/\/ Keyword Frequency\r\n        const frequency = {};\r\n        for (let word of words) {\r\n            word = word.toLowerCase();\r\n            if (!stopwords.has(word)) {\r\n                frequency[word] = (frequency[word] || 0) + 1;\r\n            }\r\n        }\r\n\r\n        const sorted = Object.entries(frequency)\r\n            .sort((a, b) => b[1] - a[1])\r\n            .slice(0, 10);\r\n\r\n        const tbody = document.getElementById(\"keywordTableBody\");\r\n        tbody.innerHTML = \"\";\r\n\r\n        if (sorted.length === 0) {\r\n            tbody.innerHTML = `<tr><td colspan=\"3\" class=\"text-center\">No keywords<\/td><\/tr>`;\r\n        } else {\r\n            for (const [word, count] of sorted) {\r\n                const density = ((count \/ wordCount) * 100).toFixed(2) + \"%\";\r\n                const row = `<tr><td>${word}<\/td><td>${count}<\/td><td>${density}<\/td><\/tr>`;\r\n                tbody.insertAdjacentHTML(\"beforeend\", row);\r\n            }\r\n        }\r\n    }\r\n\r\n    textInput.addEventListener(\"input\", () => {\r\n        analyzeText(textInput.value);\r\n    });\r\n<\/script>\r\n\n","protected":false},"excerpt":{"rendered":"<p>Instantly count the number of words in your content or text<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"tool_type":[241,238],"class_list":["post-655","tool","type-tool","status-publish","hentry","tool_type-text-analysis-tools","tool_type-text-tools"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Online Word Counter \u2013 Count Words Instantly<\/title>\n<meta name=\"description\" content=\"Use our free Word Counter tool to instantly count words, characters, lines, sentences, and paragraphs. Try our Online Word Counter tool.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/tutorialsclass.com\/tool\/word-counter\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Online Word Counter \u2013 Count Words Instantly\" \/>\n<meta property=\"og:description\" content=\"Use our free Word Counter tool to instantly count words, characters, lines, sentences, and paragraphs. Try our Online Word Counter tool.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/tutorialsclass.com\/tool\/word-counter\/\" \/>\n<meta property=\"og:site_name\" content=\"Tutorials Class\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/tutorialsclass\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-30T13:28:25+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/tutorialsclass.com\/wp-content\/uploads\/2020\/07\/tutorials-class-logo.png\" \/>\n\t<meta property=\"og:image:width\" content=\"600\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@TutorialsClass\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/tutorialsclass.com\/tool\/word-counter\/\",\"url\":\"https:\/\/tutorialsclass.com\/tool\/word-counter\/\",\"name\":\"Online Word Counter \u2013 Count Words Instantly\",\"isPartOf\":{\"@id\":\"https:\/\/tutorialsclass.com\/#website\"},\"datePublished\":\"2025-05-03T15:26:32+00:00\",\"dateModified\":\"2025-11-30T13:28:25+00:00\",\"description\":\"Use our free Word Counter tool to instantly count words, characters, lines, sentences, and paragraphs. Try our Online Word Counter tool.\",\"breadcrumb\":{\"@id\":\"https:\/\/tutorialsclass.com\/tool\/word-counter\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/tutorialsclass.com\/tool\/word-counter\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/tutorialsclass.com\/tool\/word-counter\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/tutorialsclass.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tools\",\"item\":\"https:\/\/tutorialsclass.com\/tool\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Text Tools\",\"item\":\"https:\/\/tutorialsclass.com\/tools\/text-tools\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Text Analysis Tools\",\"item\":\"https:\/\/tutorialsclass.com\/tools\/text-tools\/text-analysis-tools\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Word Counter\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/tutorialsclass.com\/#website\",\"url\":\"https:\/\/tutorialsclass.com\/\",\"name\":\"Tutorials Class\",\"description\":\"Online Tutorials for Beginners\",\"publisher\":{\"@id\":\"https:\/\/tutorialsclass.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/tutorialsclass.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/tutorialsclass.com\/#organization\",\"name\":\"Tutorials Class\",\"url\":\"https:\/\/tutorialsclass.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/tutorialsclass.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/tutorialsclass.com\/wp-content\/uploads\/2020\/05\/tutorials-class-logo.png\",\"contentUrl\":\"https:\/\/tutorialsclass.com\/wp-content\/uploads\/2020\/05\/tutorials-class-logo.png\",\"width\":442,\"height\":94,\"caption\":\"Tutorials Class\"},\"image\":{\"@id\":\"https:\/\/tutorialsclass.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/tutorialsclass\",\"https:\/\/x.com\/TutorialsClass\",\"https:\/\/in.pinterest.com\/merientinfotech\/boards\/\",\"https:\/\/www.youtube.com\/channel\/UCzbpQXlqec-bQf1_kwrTuoA\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Online Word Counter \u2013 Count Words Instantly","description":"Use our free Word Counter tool to instantly count words, characters, lines, sentences, and paragraphs. Try our Online Word Counter tool.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/tutorialsclass.com\/tool\/word-counter\/","og_locale":"en_US","og_type":"article","og_title":"Online Word Counter \u2013 Count Words Instantly","og_description":"Use our free Word Counter tool to instantly count words, characters, lines, sentences, and paragraphs. Try our Online Word Counter tool.","og_url":"https:\/\/tutorialsclass.com\/tool\/word-counter\/","og_site_name":"Tutorials Class","article_publisher":"https:\/\/www.facebook.com\/tutorialsclass","article_modified_time":"2025-11-30T13:28:25+00:00","og_image":[{"width":600,"height":600,"url":"https:\/\/tutorialsclass.com\/wp-content\/uploads\/2020\/07\/tutorials-class-logo.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_site":"@TutorialsClass","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/tutorialsclass.com\/tool\/word-counter\/","url":"https:\/\/tutorialsclass.com\/tool\/word-counter\/","name":"Online Word Counter \u2013 Count Words Instantly","isPartOf":{"@id":"https:\/\/tutorialsclass.com\/#website"},"datePublished":"2025-05-03T15:26:32+00:00","dateModified":"2025-11-30T13:28:25+00:00","description":"Use our free Word Counter tool to instantly count words, characters, lines, sentences, and paragraphs. Try our Online Word Counter tool.","breadcrumb":{"@id":"https:\/\/tutorialsclass.com\/tool\/word-counter\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/tutorialsclass.com\/tool\/word-counter\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/tutorialsclass.com\/tool\/word-counter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/tutorialsclass.com\/"},{"@type":"ListItem","position":2,"name":"Tools","item":"https:\/\/tutorialsclass.com\/tool\/"},{"@type":"ListItem","position":3,"name":"Text Tools","item":"https:\/\/tutorialsclass.com\/tools\/text-tools\/"},{"@type":"ListItem","position":4,"name":"Text Analysis Tools","item":"https:\/\/tutorialsclass.com\/tools\/text-tools\/text-analysis-tools\/"},{"@type":"ListItem","position":5,"name":"Word Counter"}]},{"@type":"WebSite","@id":"https:\/\/tutorialsclass.com\/#website","url":"https:\/\/tutorialsclass.com\/","name":"Tutorials Class","description":"Online Tutorials for Beginners","publisher":{"@id":"https:\/\/tutorialsclass.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/tutorialsclass.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/tutorialsclass.com\/#organization","name":"Tutorials Class","url":"https:\/\/tutorialsclass.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/tutorialsclass.com\/#\/schema\/logo\/image\/","url":"https:\/\/tutorialsclass.com\/wp-content\/uploads\/2020\/05\/tutorials-class-logo.png","contentUrl":"https:\/\/tutorialsclass.com\/wp-content\/uploads\/2020\/05\/tutorials-class-logo.png","width":442,"height":94,"caption":"Tutorials Class"},"image":{"@id":"https:\/\/tutorialsclass.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/tutorialsclass","https:\/\/x.com\/TutorialsClass","https:\/\/in.pinterest.com\/merientinfotech\/boards\/","https:\/\/www.youtube.com\/channel\/UCzbpQXlqec-bQf1_kwrTuoA"]}]}},"_links":{"self":[{"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/tool\/655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/tool"}],"about":[{"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/types\/tool"}],"author":[{"embeddable":true,"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/comments?post=655"}],"version-history":[{"count":1,"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/tool\/655\/revisions"}],"predecessor-version":[{"id":7588,"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/tool\/655\/revisions\/7588"}],"wp:attachment":[{"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/media?parent=655"}],"wp:term":[{"taxonomy":"tool_type","embeddable":true,"href":"https:\/\/tutorialsclass.com\/wp-json\/wp\/v2\/tool_type?post=655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}