---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/serverless/twiml-bins#article
headline: TwiML Bins
description: Create and host TwiML instructions for Twilio Voice and Messaging without your own web server. Use Handlebars templates for dynamic responses.
url: https://www.twilio.com/docs/serverless/twiml-bins
inLanguage: en
dateModified: 2026-09-01T16:40:10.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# TwiML Bins

## TwiML Bins

TwiML Bins are a serverless solution that help you provide Twilio-hosted instructions to your Twilio applications. They're a useful way to prototype and explore Twilio capabilities without needing to set up your own web server to respond to requests.

[Create your first TwiML Bin](https://www.twilio.com/console/twiml-bins)

## Tutorial

```xml !sample
<Response>
  <Message>Hello, {{From}}! You wrote: "{{ Body }}"</Message>
</Response>
```

1. Twilio manages hosting, scaling, and responding to Voice and Messaging webhooks using your TwiML
2. Write Twilio's Markup Language (TwiML) and use templating using Handlebars
3. Your code responds to traffic and scales effortlessly

Tutorial code output: "Hello, +2134567890. You wrote: 'How are you?'"

Output label: "Hello"

## Get started

You can use Twilio's Markup Language (TwiML) to instruct Twilio what to do when you've an incoming message, or what should happen during a phone call. With TwiML Bins, you can host any valid TwiML directly with Twilio, and Twilio will handle hosting and scaling as you launch your app.

## Voice TwiML

```xml
<Response>
  <Say>Hello from Twilio! We'll be connecting you.</Say>
  <Dial>
    <Number>+12065551212</Number>
  </Dial>
</Response>
```

## Messaging TwiML

```xml
<Response>
  <Message to="+12065551212">
    {{From}} wrote the following: "{{Body}}"
  </Message>
</Response>
```

### Create your first TwiML Bin

Learn how to create and configure your TwiML Bins

* [Get Started with TwiML Bins](https://www.twilio.com/docs/serverless/twiml-bins/getting-started)
* [TwiML for Twilio Voice](https://www.twilio.com/docs/voice/twiml)
* [TwiML for Twilio Messaging](https://www.twilio.com/docs/messaging/twiml)

## Build your Application

Create your first TwiML Bin, connect it to your phone number, test it, and learn how you can pass additional data into your TwiML Bins.

### Start Building

* [Get started with TwiML Bins](/docs/serverless/twiml-bins/getting-started)
* [Test your TwiML Bins](/docs/serverless/twiml-bins/testing)

## Advanced Features

TwiML Bins support limited logic-based templating using Handlebars to modify your TwiML response. For example, based on the text from an incoming SMS, or if the message contained a picture.

## Related Products

Check out our other serverless offerings for alternative ways to build complex Twilio applications, without having to worry about hosting and scaling.

### Twilio Functions and Assets

Build and host complex applications and static files for your Twilio applications using our serverless offering.

[Product Docs](/docs/serverless/functions-assets)

### Twilio Studio

Don't want to code? Create phone trees or messaging flows with our visual builder interface.

[Product Docs](/docs/studio)
