---
title: "__escapeHtml"
description: "JMeter __escapeHtml function reference: syntax, parameters, and practical examples for parameterizing test plans with dynamic values."
url: https://docs.jmeter.ai/functions/escapehtml/
lastUpdated: 2026-10-01
source: docs.jmeter.ai
---

# __escapeHtml

*Also documented in context in the [full Functions and Variables reference](/user-manual/functions/#__escapeHtml).*

Function which escapes the characters in a String using HTML entities.
Supports HTML 4.0 entities.

For example,

```bash
\${__escapeHtml("bread" & "butter")}
```

return:
`"bread" & "butter"`.

Uses `StringEscapeUtils#escapeHtml(String)` from Commons Lang.

| Name | Required | Description |
| --- | --- | --- |
| String to escape | Yes | The string to be escaped. |

## Related

- [Functions and Variables Guide](/topics/functions-and-variables/)
- [Regex Extractor Builder](/tools/regex-tester/)
- [Full Functions Reference](/user-manual/functions/)
- [Component Reference](/user-manual/component-reference/)
