# Embedding Dimension Visualizer

> Compute real cosine similarity between two texts in your browser using all-MiniLM-L6-v2. Visual 2D vector diagram, no API key needed.

Source: https://backendbootcamp.online/tools/ai-llm/embedding-visualizer/
Published: 2026-01-01
Updated: 2026-04-01

Compute real semantic similarity between two pieces of text — entirely in your browser using all-MiniLM-L6-v2. No API key, no server, no data sent anywhere.
Embedding Similarity Visualizer all-MiniLM-L6-v2 · 23 MB · browser-only 100% client-side — no data leaves your browser Text A Text B Try an example: 🟢 High similarity 🟡 Medium similarity 🔴 Low similarity Compare Embeddings &lt;!-- score panel --&gt; &lt;div style=&quot;text-align:center&quot;&gt; &lt;div id=&quot;emb-score&quot; style=&quot;font-size:3.5rem;font-weight:700;font-family:monospace;letter-spacing:-.02em&quot;&gt;0.00&lt;/div&gt; &lt;div id=&quot;emb-badge&quot; style=&quot;display:inline-block;margin-top:.5rem;padding:.3rem .85rem;border-radius:999px;font-size:.78rem;font-weight:600&quot;&gt;&lt;/div&gt; &lt;div style=&quot;margin-top:.5rem;font-size:.7rem;color:#9ca3af&quot;&gt;cosine similarity · −1 to 1&lt;/div&gt; &lt;div id=&quot;emb-dim-info&quot; style=&quot;margin-top:.35rem;font-size:.7rem;color:#9ca3af&quot;&gt;&lt;/div&gt; &lt;!-- share + CTA --&gt; &lt;div style=&quot;margin-top:1.25rem;display:flex;flex-direction:column;gap:.5rem;align-items:center&quot;&gt; &lt;button id=&quot;emb-share-btn&quot; onclick=&quot;embShare()&quot; style=&quot;font-size:.78rem;padding:.4rem 1rem;border-radius:8px;border:1px solid #d1d5db;background:transparent;cursor:pointer;width:100%;max-width:200px&quot;&gt; 📋 Copy shareable link &lt;/button&gt; &lt;div id=&quot;emb-cta&quot; style=&quot;display:none;width:100%;max-width:240px;border:1.5px solid #f59e0b;border-radius:8px;padding:.65rem;background:#fffbeb;font-size:.72rem;color:#92400e;line-height:1.4;text-align:left&quot;&gt; &lt;strong&gt;Building a RAG system?&lt;/strong&gt;&lt;br&gt; Get the free &lt;em&gt;RAG Architecture Decision Guide&lt;/em&gt; — chunking strategies, embedding model selection, reranking patterns.&lt;br&gt; &lt;a href=&quot;/guides/llm-cost-optimization&quot; style=&quot;color:#b45309;font-weight:600;text-decoration:underline;display:block;margin-top:.4rem&quot;&gt;Download free guide →&lt;/a&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- canvas visualization --&gt; &lt;div style=&quot;display:flex;flex-direction:column;align-items:center;gap:.5rem&quot;&gt; &lt;canvas id=&quot;emb-canvas&quot; width=&quot;240&quot; height=&quot;240&quot; style=&quot;max-width:100%;border-radius:8px&quot;&gt;&lt;/canvas&gt; &lt;div style=&quot;font-size:.68rem;color:#9ca3af;text-align:center&quot;&gt;vectors projected to 2D unit circle&lt;br&gt;angle = arccos(similarity)&lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- interpretation bar --&gt; &lt;div style=&quot;padding:0 1.5rem 1.5rem&quot;&gt; &lt;div style=&quot;font-size:.72rem;color:#6b7280;margin-bottom:.4rem&quot;&gt;Similarity scale&lt;/div&gt; &lt;div style=&quot;display:flex;height:6px;border-radius:999px;overflow:hidden&quot;&gt; &lt;div style=&quot;flex:1;background:#ef4444&quot;&gt;&lt;/div&gt; &lt;div style=&quot;flex:1;background:#f97316&quot;&gt;&lt;/div&gt; &lt;div style=&quot;flex:1;background:#eab308&quot;&gt;&lt;/div&gt; &lt;div style=&quot;flex:1;background:#84cc16&quot;&gt;&lt;/div&gt; &lt;div style=&quot;flex:1;background:#22c55e&quot;&gt;&lt;/div&gt; &lt;/div&gt; &lt;div style=&quot;display:flex;justify-content:space-between;font-size:.65rem;color:#9ca3af;margin-top:.25rem&quot;&gt; &lt;span&gt;−1 opposite&lt;/span&gt;&lt;span&gt;0 unrelated&lt;/span&gt;&lt;span&gt;1 identical&lt;/span&gt; &lt;/div&gt; &lt;div id=&quot;emb-scale-marker&quot; style=&quot;display:none;margin-top:.35rem;font-size:.72rem;color:#374151;font-weight:500&quot;&gt;&lt;/div&gt; &lt;/div&gt; How It Works The tool runs all-MiniLM-L6-v2 directly in your browser via Transformers.js and WebAssembly. The model (~23 MB) is downloaded once and cached permanently — subsequent runs are instant.
Both texts are encoded into 384-dimensional vectors (normalized to unit length) Cosine similarity is computed: dot(A, B) / (|A| × |B|) The result is projected onto a 2D unit circle where the angle between the two arrows equals arccos(similarity) The visualization shows the geometric meaning of cosine similarity: the smaller the angle between vectors, the more similar the meaning.
Understanding the Score Score Interpretation Example pair 0.95 – 1.00 Near-identical meaning &ldquo;I love dogs&rdquo; / &ldquo;I adore dogs&rdquo; 0.80 – 0.95 Very similar — paraphrases &ldquo;fix the bug&rdquo; / &ldquo;resolve the issue&rdquo; 0.60 – 0.80 Related topic &ldquo;Python programming&rdquo; / &ldquo;JavaScript coding&rdquo; 0.30 – 0.60 Loosely related &ldquo;database indexing&rdquo; / &ldquo;cloud storage&rdquo; 0.00 – 0.30 Unrelated &ldquo;JWT token&rdquo; / &ldquo;chocolate cake&rdquo; &lt; 0.00 Opposing / contradictory &ldquo;increase performance&rdquo; / &ldquo;degrade performance&rdquo; Why not 1.0 for identical text? all-MiniLM-L6-v2 uses float32 arithmetic — identical inputs should score exactly 1.0000. Small deviations indicate floating-point rounding in the WASM runtime.
Use This in Your Code Python — sentence-transformers (same model, local) pythonCopy from sentence_transformers import SentenceTransformer, util model = SentenceTransformer(&#39;all-MiniLM-L6-v2&#39;) texts = [&#39;I love dogs&#39;, &#39;I adore dogs&#39;, &#39;quantum physics equations&#39;] embeddings = model.encode(texts, normalize_embeddings=True) for i in range(len(texts)): for j in range(i + 1, len(texts)): score = util.cos_sim(embeddings[i], embeddings[j]).item() print(f&#39;{texts[i]!r} ↔ {texts[j]!r}: {score:.4f}&#39;) JavaScript — same model, same library javascriptCopy import { pipeline } from &#39;@xenova/transformers&#39;; const extractor = await pipeline(&#39;feature-extraction&#39;, &#39;Xenova/all-MiniLM-L6-v2&#39;); async function similarity(textA, textB) { const [a, b] = await Promise.all([ extractor(textA, { pooling: &#39;mean&#39;, normalize: true }), extractor(textB, { pooling: &#39;mean&#39;, normalize: true }), ]); const va = Array.from(a.data), vb = Array.from(b.data); return va.reduce((s, v, i) =&gt; s + v * vb[i], 0); // dot product of normalized vecs = cosine sim } console.log(await similarity(&#39;I love dogs&#39;, &#39;I adore dogs&#39;)); // ~0.97 Python — OpenAI embeddings (higher quality, paid) pythonCopy from openai import OpenAI import numpy as np client = OpenAI() def embed(text: str) -&gt; list[float]: return client.embeddings.create( model=&#39;text-embedding-3-small&#39;, input=text ).data[0].embedding def cosine(a, b): a, b = np.array(a), np.array(b) return float(np.dot(a, b) / (np.linalg.norm(a) * np.linalg.norm(b))) print(cosine(embed(&#39;I love dogs&#39;), embed(&#39;I adore dogs&#39;))) # ~0.97 Choosing an Embedding Model Model Dims Max Tokens Cost Best For all-MiniLM-L6-v2 384 256 Free (in-browser) Prototyping, client-side tools text-embedding-3-small 1536 8191 $0.02/1M Production RAG, cost-sensitive text-embedding-3-large 3072 8191 $0.13/1M Best OpenAI quality voyage-3 1024 32000 $0.06/1M Top retrieval benchmarks nomic-embed-text 768 8192 Free (local) Long-context open source Related Tools LLM Token Counter &amp; Cost EstimatorEstimate how many tokens your text chunks consume before embedding RAG Chunking SimulatorPreview how chunking strategies split your document before indexing AI Model Comparison TableCompare embedding models alongside LLMs for cost and capability System Prompt AnalyzerScore your RAG system prompt for clarity and injection risks 
