---
title: "Discussion on \"Your Random Numbers Are Biased: How Math.random() Fails and What to Use Instead\" | Hashnode"
description: "Discussion on \"Your Random Numbers Are Biased: How Math.random() Fails and What to Use Instead\". Your Random Numbers Are Biased: How Math.random() Fails and What to Use Instead\nAlmost every JavaScript developer has written this line:\nconst roll = Math.floor(Math.random() * 6) + 1;\n\nIt looks right"
url: "https://hashnode.com/posts/your-random-numbers-are-biased-how-math-random-fails-and-what-to-use-instead/6af7f9608e205b332b670b1f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Your Random Numbers Are Biased: How Math.random() Fails and What to Use Instead](https://handynest.hashnode.dev/your-random-numbers-are-biased-how-math-random-fails-and-what-to-use-instead?utm_source=hashnode&utm_medium=feed)

Your Random Numbers Are Biased: How Math.random() Fails and What to Use Instead Almost every JavaScript developer has written this line: const roll = Math.floor(Math.random() \* 6) + 1; It looks right

5d ago · 4 min read · handynest.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#random](https://hashnode.com/tag/random)
-   [#webdev](https://hashnode.com/tag/webdev)
-   [#tutorial](https://hashnode.com/tag/tutorial)

## Written by

[Muhammad Imran](https://hashnode.com/@muhammadimran)

@muhammadimran

  
[View profile](https://hashnode.com/@muhammadimran)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
