Text Language Detector - Online Identify Language from Input
Paste text and detect its language (70+ languages) using a simple character n-gram model implemented in JavaScript. No server communication.
UD5 Toolkit
Parse, visualize & understand your browser's language negotiation headers. See exactly how servers interpret your locale preferences.
navigator.languages API — approximates what your browser sends.
The Accept-Language header is an HTTP request header sent by the browser to tell the server which natural languages and locale variants the user prefers. It follows the format defined in RFC 7231, allowing the server to perform content negotiation—serving the most appropriate language version of a webpage to each visitor. For example, a typical Accept-Language header might look like: en-US,en;q=0.9,fr;q=0.7.
The q-value (quality value) ranges from 0.0 to 1.0 and indicates the user's relative preference for each language. A q=1.0 (or no q-value specified) means the highest preference. Lower values like q=0.5 indicate a secondary preference—"I'd accept this language, but only as a fallback." For example, in en-US,en;q=0.9,fr;q=0.5, the user most wants US English, will accept generic English at 90% preference, and will reluctantly accept French at 50% preference if nothing better is available.
Each browser manages language preferences differently:
Chrome: Settings → Languages → Add languages, then drag to reorder by preference.
Firefox: Settings → General → Language → Choose your preferred languages and set the priority order.
Safari: Safari → Preferences → Advanced → Language (or system-level: System Preferences → Language & Region).
Edge: Settings → Languages → Add languages and reorder them. The top language becomes your primary preference with implicit q=1.0.
When a server receives an Accept-Language header, it performs server-driven content negotiation: it compares the user's language preferences against the available translations of the requested resource. The server typically picks the highest q-value language that it supports. If no match is found, it falls back to a default language (often English) or returns a 406 Not Acceptable response. Many web frameworks like Express.js (via accepts library), Django, and ASP.NET have built-in locale negotiation middleware.
If none of the languages in your Accept-Language header match the server's available translations, the server will serve its default language version—usually the site's primary language (often English). Some websites also implement IP-based geolocation as a secondary signal for locale detection. Additionally, many sites use cookies or URL parameters (like ?lang=fr) to let users manually override the negotiated language.
You can test your website's language negotiation by:
1. Using this tool to construct and visualize different Accept-Language headers.
2. Using browser DevTools → Network conditions → override the Accept-Language header manually before making requests.
3. Using cURL with a custom header: curl -H "Accept-Language: fr-CH,fr;q=0.9" https://yoursite.com
4. Browser extensions like "Locale Switcher" that let you quickly switch between language profiles for testing.
en is a macrolanguage tag that matches any English variant, while en-US specifically requests American English. The server's matching algorithm typically treats en as a broader match—it can match en-US, en-GB, en-AU, and any other English locale. In contrast, en-US is more specific and may only match content explicitly tagged as American English. Including both in your Accept-Language (e.g., en-US,en;q=0.9) gives the server flexibility while still expressing your regional preference.
Yes! The wildcard * can be used in Accept-Language to indicate "any language is acceptable." For example: en-US,en;q=0.9,*;q=0.1 means "I strongly prefer English, but I'll accept literally anything else if English isn't available." The wildcard is typically given a very low q-value (like q=0.1) as a last-resort fallback. Without a wildcard, if no languages match, the server may return a 406 Not Acceptable status—though in practice most servers serve a default language instead.
Browsers send multiple languages because most users have graded preferences. You might be fluent in multiple languages at different levels. For instance, a Swiss user might prefer Swiss French (fr-CH), then standard French (fr), then Swiss German (de-CH), and finally accept English (en) as a fallback. Listing multiple languages with descending q-values gives the server the best chance of serving content the user can actually understand, while still respecting their primary preference.
For SEO, Accept-Language plays a role in multilingual and multiregional websites. Google recommends:
• Using separate URLs for different language versions (e.g., /en/, /fr/) with hreflang tags rather than relying solely on Accept-Language negotiation.
• Avoiding automatic redirects based on Accept-Language alone, as this can confuse search engine crawlers and prevent indexing of all language variants.
• Using Accept-Language as a supplementary signal—suggesting a language version to the user while keeping all versions crawlable via clear URL structures and hreflang annotations.
Paste text and detect its language (70+ languages) using a simple character n-gram model implemented in JavaScript. No server communication.
Enter a simple regular expression and see its equivalent Deterministic Finite Automaton diagram. Learn how regex engines work.
Highlight elements with aria‑describedby and see the linked description text. Verify a11y annotations.
Paste raw email headers and get a human-readable breakdown of the delivery route, authentication results, and delays. Private analysis.
Stack multiple background images and blend them with colors. Create unique textures. Copy the CSS code instantly.
Enter a regular expression and see a visual railroad diagram explaining the pattern. Learn and debug regex.
Start from a base color and use `oklch(from color l c h)` to create lighter or darker variants. Copy the code.
Check if an IBAN has the correct length and structure for its country. Early validation, no bank connection.
Add, remove, push, pop items and watch the data structure change visually. Supports arrays, stacks, and queues. For CS students.
Upload a text file to detect its character encoding (UTF-8, ISO-8859-1, etc.) and BOM presence. Runs entirely in your browser.
Convert normal text to Unicode mathematical bold, italic, script, fraktur, and double‑struck. Copy rich text for anywhere.
Enter a URL and see a visual map of the tab order. Detect broken tabindex values. Improve keyboard navigation.
Enter a URL and see its CORS headers. Understand why a fetch fails. Check preflight responses. Client‑side debugger.
Convert nested JSON translation files into a flat CSV table for translators. Also reverse back. Local only.
Click through the TCP connection states (LISTEN, SYN_SENT, ESTABLISHED…) and see the animated transitions. Networking education.
Detect browser support for font‑tech() and font‑format() values in @font‑face src. Check COLRv1, variable, etc.
Simulate forced‑colors mode and see how your site looks. Adjust CSS system colors. Make your design accessible.
Paste word pairs (or load pre-made sets) and practice with randomized flashcards. Flip to reveal translation, mark as known/unknown. Local data, no login.
Paste a website's HTML and see which text is only visible to screen readers (e.g., .sr‑only). Preview the accessible layer.
Paste HTML and see the order in which elements would receive focus via Tab key. Highlight issues. Local accessibility testing.
Convert text and files to Base64 or decode Base64 back to original content. Processed locally with no server upload, ensuring complete data security.
Enter a URL and extract tab‐index order violations and focusable elements. Quick accessibility audit. Client‑side fetch.
Paste two strings that look the same and see if they differ after normalization. Debug invisible encoding bugs.
Draw walls on a grid and watch A*, Dijkstra, or BFS find the shortest path. Interactive animation. Learn graph traversal.
Drag a slider to compare your original image with a compressed version (e.g., WebP). See the quality difference and file size savings.
Test different line‑break and word‑break values on Chinese/Japanese/Korean text. See how browsers wrap. Essential for i18n.
Enter a URL and a user‑agent to see if it is allowed or blocked by the robots.txt file. Quick bot validation.
See how a full paragraph looks with your chosen text and background colors. Not just a ratio; the real appearance.
Toggle between light and dark mode for a demo page. See how to use the media query. Copy the pattern.
Toggle OpenType features like liga, smcp, tnum, and see the text update. Support for variable fonts. Typography nerds.