# Convert to array

```
 Action    name: MakeArray
 
```

This command allows you to create arrays and change their sizes.

The arrays are created in 2 simple steps:

1. Create the first element of array using the data definition commands ([data](/9.0sp1/user-guide/user-interface/menu-bar/edit/convert-to-data.md), [string](/9.0sp1/user-guide/user-interface/menu-bar/edit/convert-to-string-literal.md), [structs](/9.0sp1/user-guide/user-interface/menu-bar/edit/structures.md#declare-a-structure-variable))
2. Apply the array command to the created data item. Enter array size in current array elements (not bytes). The suggested array size is the minimum of the following values:

   ```
        - the address of the next item with a cross reference
        - the address of the next user-defined name
   ```

For string literals, you can use this command to change the length of the string.

The dialog box contains the following fields:

Items on a line (meaningless for string literals):

```
        0               place maximal number of items on a line
        other value     number of items on a line
```

Please note that the [margin](/9.0sp1/user-guide/user-interface/menu-bar/options.md#text-representation-dialog) parameter affects the number of items on a line too.

Alignment (meaningless for string literals):

```
        -1              do not align items
        0               align automatically
        other value     width of each item

 Signed elements:       if checked, IDA treats all elements as signed numbers.
                        only meaningful for numbers (not for offsets and
                        segments and strings)

 Display indexes:       if checked, IDA will display the indexes of array
                        elements in the form of comments (0,1,2...)

 Create as array:       if not checked, IDA will create a separate item for
                        each array element. Useful for creating huge arrays.
                        If the box is unchecked when this command is
                        applied to string literals, IDA will create many
                        string literals instead of one big string.
```

If applied to a variable-sized structure, this command is used to specify the overall size of the structure. You cannot create arrays of variable-sized structures.

See also:

* [Edit](https://github.com/HexRaysSA/docs/blob/9.0sp1/user-guide/user-interface/menu-bar/edit/edit.md) submenu
* [How to Enter a Number](/9.0sp1/user-guide/disassembler/navigation/how-to-enter-a-number.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hex-rays.com/9.0sp1/user-guide/user-interface/menu-bar/edit/convert-to-array.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
