﻿---
title: Painless
description: Painless is a simple, secure scripting language designed specifically for use with Elasticsearch. It is the default scripting language for Elasticsearch...
url: https://www.elastic.co/elastic/docs-builder/docs/2322/reference/scripting-languages/painless/painless
products:
  - Painless
---

# Painless
*Painless* is a simple, secure scripting language designed specifically for use with Elasticsearch. It is the default scripting language for Elasticsearch and can safely be used for inline and stored scripts. For a jump start into Painless, see [A Brief Painless Walkthrough](https://www.elastic.co/elastic/docs-builder/docs/2322/reference/scripting-languages/painless/brief-painless-walkthrough). For a detailed description of the Painless syntax and language features, see the [Painless Language Specification](https://www.elastic.co/elastic/docs-builder/docs/2322/reference/scripting-languages/painless/painless-language-specification).
You can use Painless anywhere scripts are used in Elasticsearch. Painless provides:
- Fast performance: Painless scripts [ run several times faster](https://benchmarks.elastic.co/index.md#search_qps_scripts) than the alternatives.
- Safety: Fine-grained allowlist with method call/field granularity.
- Optional typing: Variables and parameters can use explicit types or the dynamic `def` type.
- Syntax: Extends a subset of Java’s syntax to provide additional scripting language features.
- Optimizations: Designed specifically for Elasticsearch scripting.