.serializeArray() returns form data as an array of { name, value } objects instead of a query string. This tutorial covers the no-argument signature, W3C successful-control rules, iterating with $.each(), equivalence with .serialize() via $.param(), transforming fields before Ajax, building plain objects for JSON APIs, and when to prefer each serialization method.
01
Object Array
{ name, value }
02
Successful
Same as serialize
03
$.each()
Iterate fields
04
$.param()
→ query string
05
Transform
Edit before send
06
JSON
Map to object
Fundamentals
Introduction
.serialize() gives you one URL-encoded string — perfect for $.post(), but awkward when you need to rename a field, drop empty values, or inspect each input separately. .serializeArray() returns structured data instead: an array where every successful control becomes { name: "fieldName", value: "fieldValue" }.
That array is what jQuery passes to $.param() inside .serialize(). Exposing it directly lets you modify the list, convert it to JSON, or build a plain object before sending. Same successful-control rules apply — only named, enabled, checked-as-required fields appear.
Concept
Understanding .serializeArray()
.serializeArray() is a collection method that accepts no arguments and returns an Array of plain objects. Each object has exactly two properties: name (string) and value (string). Empty arrays are valid when no successful controls exist.
The method uses W3C rules for successful controls — identical to .serialize(). Multi-select options produce one object per selected option with the same name. Checkboxes without a value attribute serialize as value: "on" when checked.
💡
Beginner Tip
Log the array during development: console.log( JSON.stringify( $( "form" ).serializeArray(), null, 2 ) ). When you are ready to POST, either call $.param( array ) or switch to .serialize() if no transforms are needed.
📋 .serializeArray() vs .serialize() vs FormData vs manual loop
Four ways to read form data — pick based on output shape and whether you need files or transforms.
.serializeArray()
[{ name, value }]
Structured array — iterate, filter, map; pass to $.param() for query strings
.serialize()
query string
One-liner URL-encoded string — $.param(serializeArray()) under the hood
FormData
native + files
new FormData(form) — includes file inputs; use with $.ajax processData:false
Manual loop
:input each
$(":input").each(...) — full control but reinvents successful-control rules
Use .serializeArray() when you need structured access to each field. Use .serialize() for direct Ajax POST strings. Use FormData for file uploads. Avoid manual loops unless you have unusual control types.
Hands-On
Examples Gallery
Five progressive examples from a basic array on submit through official-style iteration, $.param equivalence, field transforms, and mapping to a JSON-friendly object. Each links to a Try-it lab.
📚 Core Patterns
Read form values as a name/value array.
Example 1 — Basic .serializeArray() on submit
Official pattern: log the array inside a submit handler with preventDefault.
Submit form → #json-out shows formatted array
Each entry: { "name": "...", "value": "..." }
Unchecked boxes and unnamed inputs omitted
How It Works
Unlike .serialize(), you receive structured data immediately — no parsing required. Display with JSON.stringify for debugging or pass the array to your own logic.
Example 2 — Official demo — iterate with $.each()
Adapted from the jQuery API docs: rebuild a live results display from serialized field values.
Toggle controls → #results shows "name=value" chips
Each field object exposes .name and .value separately
Useful for custom UI without string parsing
How It Works
The official demo selects :input controls directly. Inside a <form>, prefer $( "form" ).serializeArray() to avoid duplicate entries from nested selections.
Example 3 — $.param( serializeArray() ) equals .serialize()
Prove the internal pipeline — modify the array only when you need to.
serializeArray → { username: "john", email: "..." }
JSON.stringify → POST body for REST API
Duplicate names: last value wins in simple map — use reduce for arrays
How It Works
Simple forEach mapping works for flat forms. Multi-select and duplicate names need a smarter reducer — or stay with $.param() for form-encoded POST.
Applications
🚀 Common Use Cases
Debug forms — inspect exact name/value pairs before Ajax submission.
Field filtering — remove empty optional inputs or internal-only fields.
Add hidden tokens — push CSRF or session values into the array before $.param().
Custom validation UI — iterate and highlight fields by field.name.
JSON API bridge — map array to object then JSON.stringify.
Multi-step wizards — merge arrays from partial forms before one POST.
🧠 How .serializeArray() Works Internally
1
Resolve control set
If matched element is a <form>, gather successful controls inside it. Otherwise serialize controls in the jQuery set.
.serialize() === $.param( .serializeArray() ) when the array is unmodified.
Duplicate name keys are valid — multi-select and repeated fields produce multiple objects.
Simple object mapping loses duplicate names — last value wins; use arrays or $.param().
File inputs never appear — use FormData for uploads.
Available since jQuery 1.2 — one release after .serialize() (1.0).
Compatibility
Browser Support
.serializeArray() is part of jQuery’s core form helpers — not a native DOM API. It works wherever jQuery runs: all browsers supported by your jQuery version.
✓ jQuery 1.2+
jQuery .serializeArray() method
Supported in jQuery 1.x, 2.x, and 3.x across all modern browsers and IE with supported jQuery builds. HTML5 input types follow the same successful-control rules as .serialize().
100%With jQuery
Google ChromeAll versions · Desktop & Mobile
Full support
Mozilla FirefoxAll versions · Desktop & Mobile
Full support
Apple SafariAll versions · macOS & iOS
Full support
Microsoft EdgeAll versions · Chromium & Legacy
Full support
Internet ExplorerIE 6+ · Legacy environments
Full support
OperaAll modern versions
Full support
.serializeArray()Universal
Bottom line: Safe in any jQuery project with forms. Pair with $.param() for query strings or map to objects for JSON APIs.
Wrap Up
Conclusion
.serializeArray() is the structured sibling of .serialize() — same successful controls, but an array of { name, value } objects you can iterate, filter, and transform. Encode with $.param() when you need a query string, or map to a plain object for JSON APIs.
Use .serializeArray() when you need to modify fields before sending
Select $( "form" ) for standard forms — avoid duplicate entries
Pass transformed arrays through $.param() for form-encoded POST
Log with JSON.stringify during development
Fall back to .serialize() when no transforms are needed
❌ Don’t
Assume simple object mapping handles duplicate field names
Expect file inputs in the array — use FormData
Forget unchecked checkboxes are omitted entirely
Mutate the array then expect .serialize() to match — re-call or use $.param
Send raw array as POST body without encoding — servers expect strings or JSON
Summary
Key Takeaways
Knowledge Unlocked
Six things to remember about .serializeArray()
Form in, object array out.
6
Core concepts
[]01
Array Output
{ name, value }
Structure
ok02
Same Rules
As .serialize()
Controls
each03
$.each()
Iterate fields
Loop
pr04
$.param()
→ query string
Encode
edit05
Transform
Filter/push
Mutate
{ }06
JSON map
Plain object
API
❓ Frequently Asked Questions
jQuery .serializeArray() is a collection method that encodes successful form controls as an array of plain objects — each with name and value properties. Call $("form").serializeArray() to get [{ name: "email", value: "a@b.com" }, ...]. It accepts no arguments and returns an Array, not a string. Use it when you need to inspect, filter, or transform individual fields before sending data.
.serializeArray() returns an array of { name, value } objects. .serialize() returns the same data encoded as one URL query string via $.param(). They use identical successful-control rules. Use .serializeArray() when you need per-field logic; use .serialize() when you already want a string for $.post() or query URLs. Note: $(form).serialize() equals $.param($(form).serializeArray()).
Same rules as .serialize() and native HTML forms: each control must have a name attribute and must not be disabled. Checkboxes and radios appear only when checked. File inputs are excluded. Submit button values are not included. Controls without a value attribute use an empty string.
Yes — that is exactly what .serialize() does internally. $.param($("form").serializeArray()) produces the same URL-encoded string as $("form").serialize(). After .serializeArray(), you can modify the array (add, remove, or change entries) and then call $.param() on the result for a custom query string.
The array structure is JSON-serializable — JSON.stringify($("form").serializeArray()) produces valid JSON. Many REST APIs expect a flat object instead; map the array with a reduce or loop. For JSON APIs, building a plain object or using FormData may be clearer than a name/value array.
Select the form element: $("form").serializeArray(). jQuery finds successful controls inside the form. Selecting both form and its inputs in one set can duplicate entries. You may select individual inputs when they are not inside a form wrapper.
Did you know?
.serializeArray() arrived in jQuery 1.2 — one release after .serialize(). The array format is exactly what $.param() accepts, which is why jQuery could add structured access without changing the wire format. The official API docs demo uses $.each() on the array to append each field.value to a results div — the same live-preview pattern as the .serialize() tutorial, but with structured objects instead of parsing a query string.