# form-urlencoded

> Return an object as an 'x-www-form-urlencoded' string

Latest version **6.1.7** (published 2026-05-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install form-urlencoded
pnpm add form-urlencoded
yarn add form-urlencoded
bun add form-urlencoded
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 6.1.7 |
| Published | 2026-05-29 |
| First published | 2013-06-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 82 |
| Author | Chris |
| Maintainers | bumblehead |
| Keywords | querystring, x-www-form-urlencoded, www-form-urlencoded, form-urlencoded, urlencoded, urlencode, encoding, encoded, encode, form, json encode |

## Links

- npm: https://www.npmjs.com/package/form-urlencoded
- Repository: https://github.com/iambumblehead/form-urlencoded
- Homepage: https://github.com/iambumblehead/form-urlencoded#readme
- Issues: https://github.com/iambumblehead/form-urlencoded/issues
- npm.io page: https://npm.io/package/form-urlencoded

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 6.1.7 (latest) — 2026-05-29
- 6.1.6 — 2025-09-04
- 6.1.5 — 2024-04-29
- 6.1.4 — 2023-09-24
- 6.1.3 — 2023-09-11
- 6.1.2 — 2023-09-11
- 6.1.1 — 2023-09-11
- 6.1.0 — 2022-07-29
- 6.0.7 — 2022-07-23
- 6.0.6 — 2022-02-03
- 6.0.5 — 2021-10-20
- 6.0.4 — 2021-05-14
- 6.0.3 — 2021-04-21
- 6.0.2 — 2021-04-20
- 6.0.0 — 2021-04-13
- … 67 more at https://npm.io/package/form-urlencoded/versions

## README

form-urlencoded
===============
**(c)[Bumblehead][0], [JBlashill][6]**

[![npm version](https://badge.fury.io/js/form-urlencoded.svg)](https://badge.fury.io/js/form-urlencoded) [![Build Status](https://github.com/iambumblehead/form-urlencoded/workflows/test/badge.svg)][2]

Returns 'x-www-form-urlencoded' string data, an encoding often used when an [HTML form is submitted][1]. Form data is serialised in [this format][2] and sent to a server.

```javascript
import formurlencoded from 'form-urlencoded'
// or:
// var formurlencoded = require('form-urlencoded')

const obj = {
  str: 'val',
  num: 0,
  arr: [3, {prop: false}, 1, null, 6],
  obj: {prop1: null, prop2: ['elem']}
}

console.log(formurlencoded(obj))
// str=val&num=0&arr%5B0%5D=3&arr%5B1%5D%5Bprop%5D=false
// &arr%5B2%5D=1&arr%5B3%5D=null&arr%5B4%5D=6&obj%5Bprop
// 1%5D=null&obj%5Bprop2%5D%5B0%5D=elem

console.log(formurlencoded(obj, {
  ignorenull: true,
  skipIndex: true,
  sorted: true
}))
// arr%5B%5D=3&arr%5B%5D%5Bprop%5D=false&arr%5B%5D=1&arr
// %5B%5D=6&num=0&obj%5Bprop2%5D%5B%5D=elem&str=val

console.log(formurlencoded(obj, {
  ignoreEmptyArray: true,
  ignorenull: true,
  useDot: true,
  skipIndex: true,
  skipBracket: true
}))
// str=val&num=0&arr=3&arr.prop=false&arr=1&arr=6&obj.pr
// op2=elem
```

[0]: http://www.bumblehead.com                            "bumblehead"
[1]: http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1  "w3c"
[2]: http://www.w3.org/TR/html5/forms.html#url-encoded-form-data "w3c"
[3]: http://nodejs.org/api/querystring.html               "node.js qs"
[4]: www.ruby-doc.org/stdlib-1.9.3/libdoc/uri/rdoc/URI.html    "rails"
[5]: https://github.com/visionmedia/node-querystring           "tj qs"
[6]: https://github.com/jblashill/form-urlencoded          "jblashill"
[7]: https://raw.githubusercontent.com/iambumblehead/es5classic/master/es5classic_120x120.png


![scrounge](https://github.com/iambumblehead/scroungejs/raw/main/img/hand.png)


(The MIT License)

Copyright (c) [Bumblehead][0] <chris@bumblehead.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


[2]: https://github.com/iambumblehead/form-urlencoded "form-urlencoded"

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