basic

Cosine Similarity from Dot Product and Norms Calculator

cos θ = (a · b) / (‖a‖ · ‖b‖).

Compute the cosine similarity between two vectors when only the dot product and the two L2-norms are pre-computed: cos θ = (a · b) / (‖a‖ · ‖b‖). Range: −1 (opposite) → 0 (orthogonal) → +1 (parallel). Heavily used in IR, NLP, and recommender systems.

Published Last reviewed 1 min read

Inputs

Results

Enter values and click Calculate to see results.
Was this helpful?

How to use this calculator

  1. Fill in the inputs above using the units you already have.
  2. Values update automatically as you type — no submit button needed.
  3. Hover any result row for the underlying formula and intermediate values.

Formula

cos θ = (a · b) / (‖a‖ · ‖b‖).

In depth

Compute the cosine similarity between two vectors when only the dot product and the two L2-norms are pre-computed: cos θ = (a · b) / (‖a‖ · ‖b‖). Range: −1 (opposite) → 0 (orthogonal) → +1 (parallel). Heavily used in IR, NLP, and recommender systems.