> For the complete documentation index, see [llms.txt](https://fozan.gitbook.io/level/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fozan.gitbook.io/level/methods/calculatelevel.md). Agents can also search and read this documentation through its [MCP server](https://fozan.gitbook.io/level/~gitbook/mcp).

# calculateLevel

Calculate the level based on the current experience.

Method `calculateLevel`

**Parameters:**

* `experience` (number): The current experience points.

**Returns:**

* `number`: The calculated level.

**Example Usage:**

```javascript
const LevelAlgorithm = require('level-algorithm');

const levelAlgorithm = new LevelAlgorithm({
  baseExperience: 100,
  experienceMultiplier: 1.5
});

const currentExperience = 350;

const currentLevel = levelAlgorithm.calculateLevel(currentExperience);

console.log(currentLevel); // Output: 5 (based on example current experience)
```

This method calculates the current level based on the provided current experience, base experience, and experience multiplier within the `LevelAlgorithm` instance.
