.serializeArray() (since jQuery 1.2) encodes successful form controls as an array of { name, value } objects — ready to inspect, filter, or pass to $.param(). It takes no arguments and returns an Array.
Syntax
Start with these common calls. Keep them short and readable.
jQuery
$("form").serializeArray()
// → [ { name: "a", value: "1" }, { name: "b", value: "2" } ]
// Prefer the <form> itself (not form + children)
// Same successful-control rules as .serialize()
// $.param(arr) === $("form").serialize()
Call
What it does
Matched set
A <form> or form controls to read
name on controls
Nameless fields are skipped
Arguments
Method takes no parameters
Return value
Array of { name, value }
Load jQuery before your script (CDN or local file), then wrap DOM work in $(function () { ... }) when needed.
Parameters
Parameter
Description
Step 1
Give every field you care about a name attribute.
Step 2
Select the <form> (or a set of controls) with jQuery.
Step 3
Call .serializeArray() to get [{ name, value }, …].
Return Value
Return Value
Description
Value / undefined
Getters usually return a value from the first matched element, or undefined when nothing applies.
jQuery Examples
Example 1 — Basic Array on Submit
Official idea: prevent navigation and log the name/value array.
jQuery
$("#demo").on("submit", function (event) {
event.preventDefault();
var fields = $(this).serializeArray();
$("#json-out").text(JSON.stringify(fields, null, 2));
});
Array path. Build the array, then encode with $.param().
String path..serialize() does that pipeline internally.
Same rules. Both use identical successful-control filtering.
Frequently Asked Questions
jQuery .serializeArray() encodes successful form controls as an array of plain objects — each with name and value properties. Call $("form").serializeArray() to get [{ name: "email", value: "[email protected]" }, …]. It takes no arguments and returns an Array, not a string.
.serializeArray() returns an array of { name, value } objects. .serialize() returns the same data as one URL query string. They use the same successful-control rules. Note: $(form).serialize() equals $.param($(form).serializeArray()).
Same rules as native HTML form submit: each control needs a name and must not be disabled. Checkboxes and radios appear only when checked. File inputs and submit button values are excluded. Missing value attributes become an empty string.
Yes — that is what .serialize() does internally. $.param($("form").serializeArray()) produces the same string as $("form").serialize(). You can modify the array first, then call $.param().
Yes — JSON.stringify($("form").serializeArray()) is valid JSON. Many APIs expect a flat object instead; map the array with a loop or reduce. For uploads use FormData, not serializeArray.
Prefer $("form").serializeArray(). Selecting both the form and its children in one set can duplicate entries. You may select individual controls when they are not inside a form.