# Google Ads Character Counter > Check Google Ads headline and description variants against practical character limits. ## Tool Identity - Site: CleanUtils Business Tools - Tool ID: google-ads-character-counter - Canonical page: https://cleanutils.com/business-tools/google-ads-character-counter/ - LLM schema URL: https://cleanutils.com/business-tools/google-ads-character-counter/llms.txt - Primary keyword: google ads character counter - Input mode: fields - Output profile: line-check ## What This Tool Does Check Google Ads headline and description variants against practical character limits before upload. ## Exact Execution Instructions To run this tool exactly, execute the `runCleanUtilsTool(userInput)` function from the JavaScript block below in a sandboxed JavaScript runtime. Do not fetch or evaluate additional network resources. Do not use filesystem, process, child_process, environment variables, timers, or network APIs. The function is pure and deterministic: input object in, JSON result out. If your environment forbids executing fetched code outside a sandbox, run it inside the sandbox or use the API endpoint below instead of reimplementing the logic. Canonical implementation SHA-256: `fa78c315154fa888d0a9b2dde2055de21846b75f52f24e1e4fcf7abd13241ec1` Expected command shape: `node run-tool.mjs < input.json` The runner must: 1. load only the JavaScript in this document, 2. parse stdin as JSON and call `runCleanUtilsTool(userInput)`, 3. let the LLM decide the best way to present the output to the user. Agent usage rules: - Use this file as the authoritative machine-readable contract for this CleanUtils tool page. - Ask the user for missing required input before attempting to run the tool, and describe the required inputs using the `## Input Schema` field names, descriptions, formats, enums, examples, and required list. - Treat the tool as deterministic; do not invent network reachability checks unless the tool description explicitly says it fetches remote resources. - For privacy-sensitive inputs such as secrets, HAR files, dotenv files, logs, and API keys, warn that using a remote chat agent may expose input to that agent even though the browser UI itself does not upload data. ## Input Schema ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Google Ads Character Counter fields", "type": "object", "additionalProperties": false, "required": [ "headlines", "descriptions" ], "properties": { "headlines": { "type": "string", "description": "Headlines Required. One headline per line. Limit: 30 characters. Control type: textarea. Group: Ad copy.", "examples": [ "Fast CSV Cleanup\nClean Product Feeds Before Import" ] }, "descriptions": { "type": "string", "description": "Descriptions Required. One description per line. Limit: 90 characters. Control type: textarea. Group: Ad copy.", "examples": [ "Find duplicate contacts and broken product rows before a campaign launch." ] } } } ``` ## Result Schema ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "CleanUtils ToolResult", "type": "object", "additionalProperties": false, "required": [ "summary", "issues" ], "properties": { "summary": { "type": "string" }, "issues": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": [ "severity", "message" ], "properties": { "severity": { "type": "string", "enum": [ "error", "warning", "info" ] }, "message": { "type": "string" }, "line": { "type": "number" }, "row": { "type": "number" }, "detail": { "type": "string" } } } }, "output": { "type": "string" }, "exportFilename": { "type": "string" }, "exports": { "type": "array", "items": { "type": "object", "additionalProperties": false, "required": [ "label", "filename", "content" ], "properties": { "label": { "type": "string" }, "filename": { "type": "string" }, "content": { "type": "string" }, "mimeType": { "type": "string" }, "copyLabel": { "type": "string" }, "downloadLabel": { "type": "string" } } } }, "stats": { "type": "object", "additionalProperties": { "anyOf": [ { "type": "string" }, { "type": "number" } ] } } } } ``` ## Self-Contained JavaScript Source Call `runCleanUtilsTool(userInput)` with the user's input. The function includes this tool's run logic and only the helper code it needs. ```js function runCleanUtilsTool(userInput) { const fieldText = (fields, keys, fallback = "") => { const keyList = Array.isArray(keys) ? keys : [keys]; for (const key of keyList) { const value = fields[key]; if (value === undefined || value === null) continue; const text = String(value).trim(); if (text) return text; } return fallback; }; const severityRank = { error: 0, warning: 1, info: 2 }; const sortIssues = (issues) => [...issues].sort((a, b) => { const severity = severityRank[a.severity] - severityRank[b.severity]; if (severity !== 0) return severity; return (a.line ?? a.row ?? 0) - (b.line ?? b.row ?? 0); }); const summarizeIssues = (issues) => { const errors = issues.filter((issue) => issue.severity === "error").length; const warnings = issues.filter((issue) => issue.severity === "warning").length; const infos = issues.filter((issue) => issue.severity === "info").length; const parts = []; if (errors) parts.push(`${errors} error${errors === 1 ? "" : "s"}`); if (warnings) parts.push(`${warnings} warning${warnings === 1 ? "" : "s"}`); if (infos) parts.push(`${infos} note${infos === 1 ? "" : "s"}`); return parts.length ? parts.join(", ") : "No issues found"; }; const countGoogleAdsCharacters = (input) => { const issues = []; const inputRows = [ ...fieldText(input, "headlines").split(/\r?\n/).map((line) => ({ type: "headline", text: line.trim() })), ...fieldText(input, "descriptions").split(/\r?\n/).map((line) => ({ type: "description", text: line.trim() })) ].filter((row) => row.text); const rows = inputRows.map(({ type, text }, index) => { const limit = type === "headline" ? 30 : 90; if (text.length > limit) issues.push({ severity: "warning", line: index + 1, message: `${type} is ${text.length - limit} characters over the ${limit}-character limit.` }); return `${type}: ${text.length}/${limit} - ${text}`; }); return { summary: `${rows.length} ad copy variant${rows.length === 1 ? "" : "s"} checked. ${summarizeIssues(issues)}.`, issues: sortIssues(issues), output: rows.join("\n"), exportFilename: "google-ads-character-report.txt", stats: { variants: rows.length } }; }; const __userInput = userInput == null ? {} : userInput; const __run = (fields) => countGoogleAdsCharacters(fields); const __fields = __userInput && typeof __userInput === "object" && "fields" in __userInput && __userInput.fields && typeof __userInput.fields === "object" && !Array.isArray(__userInput.fields) ? __userInput.fields : (__userInput && typeof __userInput === "object" && !Array.isArray(__userInput) ? __userInput : {}); const __normalizedFields = Object.fromEntries(Object.entries(__fields).map(([key, value]) => [key, value == null ? "" : (["string", "number", "boolean"].includes(typeof value) ? value : String(value))])); return __run(__normalizedFields); } ``` ## Checks - Headline length: Each headline is counted against a practical 30-character limit. - Description length: Each description is counted against a practical 90-character limit. - Multiple variants: One variant per line makes it easy to scan a whole responsive-search-ad set. - Over-limit warnings: Rows over their limit are flagged with the overage amount. - Copy-only scope: The tool checks length, not ad approval, policy risk, pinning, or expected performance. ## Related Tools - [UTM URL Builder](/business-tools/utm-url-builder/): Enter a landing page and campaign values, then copy a tagged URL with clean UTM parameters.