# open-simplex-noise

> OpenSimplex noise for TypeScript/JavaScript

Latest version **3.0.0** (published 2026-08-23) · Unlicense license · 0 weekly downloads

## Install

```sh
npm install open-simplex-noise
pnpm add open-simplex-noise
yarn add open-simplex-noise
bun add open-simplex-noise
```

## Health

**Score 65/100 (B)** — status: active.

Positive: esm support; no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2026-08-23 |
| First published | 2017-02-15 |
| Weekly downloads | 0 |
| License | Unlicense |
| TypeScript types | none |
| Module format | ESM |
| Node | >=22 |
| Dependencies | 0 |
| Unpacked size | 83.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 161 |
| Author | Josh Forisha |
| Maintainers | joshforisha |
| Keywords | noise, open-simplex-noise, procedural-generation, simplex-noise |

## Links

- npm: https://www.npmjs.com/package/open-simplex-noise
- Repository: https://github.com/joshforisha/open-simplex-noise
- Homepage: https://github.com/joshforisha/open-simplex-noise#readme
- Issues: https://github.com/joshforisha/open-simplex-noise/issues
- npm.io page: https://npm.io/package/open-simplex-noise

## Recent versions

- 3.0.0 (latest) — 2026-08-23
- 3.0.0-pre3 (pre) — 2026-08-23
- 3.0.0-pre2 — 2026-08-23
- 2.5.0 — 2021-04-15
- 2.5.0-pre1 — 2021-04-15
- 2.4.0 — 2020-12-21
- 2.4.0-pre4 — 2020-07-16
- 2.4.0-pre3 — 2020-07-16
- 2.4.0-pre2 — 2020-07-16
- 2.3.1 — 2020-04-20
- 2.3.0 — 2020-04-13
- 2.2.0 — 2019-12-06
- 2.1.0 — 2019-12-06
- 2.0.0 — 2019-12-06
- 1.7.0 — 2019-10-28
- … 10 more at https://npm.io/package/open-simplex-noise/versions

## README

# OpenSimplex Noise

TypeScript implementation of [OpenSimplex noise](https://en.wikipedia.org/wiki/OpenSimplex_noise).

- JSR package: [@joshforisha/open-simplex-noise](https://jsr.io/@joshforisha/open-simplex-noise)
- NPM package: [open-simplex-noise](https://www.npmjs.com/package/open-simplex-noise)

## Example

```javascript
import { makeNoise2D } from "open-simplex-noise";
// import { makeNoise2D } from "jsr:@joshforisha/open-simplex-noise"

const [width, height] = [888, 222];
const canvas = document.querySelector("canvas");
const ctx = canvas.getContext("2d");
const imageData = ctx.createImageData(width, height);
const noise2D = makeNoise2D(Date.now()); // Using current date as seed

for (let x = 0; x < width; x++) {
  for (let y = 0; y < height; y++) {
    const i = (x + y * width) * 4;
    const value = (noise2D(x, y) + 1) * 128;
    imageData.data[i] = value;
    imageData.data[i + 1] = value;
    imageData.data[i + 2] = value;
    imageData.data[i + 3] = 255;
  }
}
ctx.putImageData(imageData, 0, 0);
```

![Example output](https://raw.githubusercontent.com/joshforisha/open-simplex-noise-js/main/images/example.png)

## Fractal Noise

For _fractal noise_ results, which typically involves scaling frequencies and stacking octaves, see [joshforisha/fractal-noise](https://github.com/joshforisha/fractal-noise) (JSR: [@joshforisha/fractal-noise](https://jsr.io/@joshforisha/fractal-noise), NPM: [fractal-noise](https://www.npmjs.com/package/fractal-noise)). The functions there can be used with this library's noise algorithm to obtain varied results like the following:

![Example fractal noise output](https://raw.githubusercontent.com/joshforisha/fractal-noise-js/main/images/rectangle-low-8.png)

## API

Each noise function returns a float between -1 and 1, exclusive: `(-1.0, 1.0)`.

```typescript
type Noise2D = (x: number, y: number) => number;
type Noise3D = (x: number, y: number, z: number) => number;
type Noise4D = (x: number, y: number, z: number, w: number) => number;
```

#### `makeNoise2D (seed: number) => Noise2D`

Initializes and returns a function to generate 2D noise.

#### `makeNoise3D (seed: number) => Noise3D`

Initializes and returns a function to generate 3D noise.

#### `makeNoise4D (seed: number) => Noise4D`

Initializes and returns a function to generate 4D noise.

---
_Source: https://npm.io/package/open-simplex-noise · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
