DevTools Surf logoDevTools Surf
AI / Modern DevAnimation / CSSAPI / Config
Sign in
DevTools Surf logoDevTools Surf
AI / Modern DevAnimation / CSSAPI / Config
Sign in
HomeAI / Modern DevEmbedding Distance Calculator

Example: Embedding Distance Calculator

A worked example, rendered from real sample data. Sign in to run the tool on your own input.

Input
0.1,0.5,0.3,0.8,0.2,0.9,0.4,0.7
---
0.2,0.4,0.35,0.75,0.25,0.85,0.45,0.65
Output
═══ Summary ═══
Vectors: 2
Dimensions: 8
Primary metric: cosine
Magnitudes: Vector 1 1.5780 | Vector 2 1.5149
═══ Vector 1 vs Vector 2 ═══
Cosine similarity: 0.993511
Cosine distance: 0.006489
Euclidean distance: 0.187083
Manhattan distance: 0.500000
Dot product: 2.375000
Angle: 6.53°
✓ Near-identical direction
═══ Nearest neighbours by cosine ═══
Vector 1: Vector 2 0.993511
Vector 2: Vector 1 0.993511
═══ Choosing a metric ═══
ℹ Cosine similarity compares direction only and ignores length. It is the usual choice for embeddings, and for L2-normalised vectors it ranks identically to dot product and Euclidean distance.
ℹ Scores are only comparable inside one embedding model. A cosine of 0.82 may mean 'unrelated' for one model and 'near duplicate' for another, so calibrate a threshold on your own data instead of copying one.
ℹ Everything is computed from the numbers you pasted; no model is called and no text is embedded here.

About Embedding Distance Calculator

Embedding Distance Calculator preview - AI / Modern Dev tool

Calculate cosine similarity between two text embedding vectors. Part of the DevTools Surf developer suite. Browse more tools in the AI / Modern Dev collection.

Use Cases

  • ML engineers evaluating semantic search result quality
  • NLP researchers comparing sentence similarity across models
  • RAG developers tuning retrieval thresholds for AI chatbots
  • Data scientists clustering documents by embedding proximity

Tips

  • Cosine similarity near 1.0 means vectors are semantically aligned
  • Compare multiple vectors to find the closest semantic match
  • Normalize vectors to unit length before computing distances

Fun Facts

  • Cosine similarity was first used in information retrieval by Gerard Salton's SMART system at Cornell in the 1960s, decades before modern embeddings existed.
  • OpenAI's text-embedding-ada-002 produces 1,536-dimensional vectors — each dimension captures a subtle aspect of meaning that humans cannot individually interpret.
  • The 'king - man + woman = queen' analogy from Mikolov's 2013 Word2Vec paper demonstrated that vector arithmetic could capture semantic relationships, launching the embedding revolution.

FAQ

What's cosine similarity?
Measures the angle between two vectors regardless of magnitude. Ranges from -1 (opposite) to 1 (identical). 0 is unrelated.
Which embedding models does it work with?
Any embedding vector — OpenAI text-embedding-3, Cohere embeddings, Sentence Transformers, all work the same way. Paste the vectors; the math is model-agnostic.
What's a 'similar enough' threshold?
Depends on model and data. Often >0.8 is 'similar', >0.95 is 'near duplicate'. Calibrate on your own data; there's no universal threshold.
Why cosine and not Euclidean?
Cosine ignores magnitude — only direction matters. For language embeddings, direction captures meaning better than raw distance. Most vector DBs default to cosine.

Related AI / Modern Dev Tools

Token CounterPrompt Template RendererMarkdown → Slack/DiscordMarkdown → Slack mrkdwnSentiment AnalyzerKeyword ExtractorText SummarizerDuplicate Content Detector
New · Flagshipsimple REST client

REST Handler — Collections, env vars, history, cURL converter

Send requests, save collections (nested), swap environments, and convert between cURL / Collection JSON / REST Handler YAML.

Open

Popular tools

The most-used tools on DevToolsSurf, one click away.

Encoding & crypto

  • Base64 Encode
  • Base64 Decode
  • URL Encoder
  • URL Decoder
  • Hash Generator
  • JWT Decoder
  • JWT Encoder
  • UUID Generator
  • ULID Generator
  • Password Generator
  • Bcrypt Hash Tester

Converters

  • CSV to JSON
  • JSON to CSV
  • XML to JSON
  • JSON to XML
  • HTML → Markdown
  • HTML → React JSX
  • cURL to Code
  • Collection JSON → cURL
  • Swagger to Collection JSON
  • JSON → Go Struct
  • JSON → TypeScript Types

JSON & YAML

  • JSON Formatter
  • JSON Validator
  • JSON Viewer
  • JSON Minifier
  • JSON Diff
  • JSONPath Tester
  • YAML Formatter
  • YAML to JSON
  • JSON to YAML

Text & regex

  • Regex Tester
  • Text Diff
  • Case Converter
  • Word Counter
  • Markdown Preview
  • Slug Generator
  • Lorem Ipsum Generator
  • Markdown → PDF

CSS & color

  • CSS Beautifier
  • Minify CSS
  • Color Converter
  • Gradient Generator
  • Contrast Checker
  • Color Palette Generator
  • Flexbox Playground
  • Tailwind → CSS

Generators

  • QR Code Generator
  • Mock Data Generator
  • Favicon Generator
  • .gitignore Builder
  • README.md Generator
  • Dockerfile Generator
  • Sitemap Generator

API & networking

  • REST Handler
  • HTTP Header Analyzer
  • IP Address Lookup
  • CIDR Calculator
  • User-Agent Parser
  • HTTP Status Reference
  • OpenAPI Viewer

Date & time

  • Timestamp Converter
  • Timezone Converter
  • Cron Expression Parser
  • Duration Calculator
  • Age Calculator
  • Date Format Converter

Images

  • Image Converter
  • Image Resizer (Batch)
  • SVG Optimizer
  • Base64 ↔ Image
  • WebP ↔ AVIF Converter
  • Image Compressor

PDF tools

  • PDF Merger
  • PDF Splitter
  • PDF Compressor
  • Markdown → PDF
  • EPUB → PDF
  • MOBI / AZW → PDF
  • DOCX → PDF
  • HTML → PDF

Resources

  • Community feed
  • Themes marketplace
  • Pricing & credits
  • Privacy policy
  • Terms of service
  • Sitemap
  • robots.txt

Your account

  • Sign in
  • Dashboard
  • Run history
  • My profile
  • Settings
DevTools Surf logo
DevTools Surf919+ tools

Fast · privacy-first · client-side · © 2026

Home·Feed·ThemesPricing·Sign inPrivacy·Sitemap Feedback