Knowing how to AutoFit columns in Excel is one of the smallest but most useful Excel skills. AutoFit makes a column exactly as wide as the longest value in it โ no more, no less. The result is a clean spreadsheet where every value is fully visible without manual width adjustment. Five seconds of AutoFit can save hours of fiddling with column boundaries on a busy worksheet, and the same shortcut works for row heights too.
This guide covers every way to AutoFit columns in Excel: the double-click trick on column boundaries, the Home tab Format menu, the keyboard shortcut sequence Alt+H+O+I, AutoFit applied to a selection rather than the entire column, the same techniques applied to row heights, the limitations and pitfalls (merged cells, wrapped text, hidden cells), how to set a default column width for new columns, when AutoFit isn't the right answer, and the VBA approach for power users automating the operation across many columns or many workbooks.
The single most useful trick โ the one that everyone should learn first โ is the double-click on the column boundary. With your mouse, hover over the right edge of any column header letter (A, B, C, etc.) until the cursor turns into a horizontal arrow. Double-click. The column resizes to exactly fit the widest content. The same trick works on row boundaries to AutoFit row heights. Once you know it, you'll find yourself using it dozens of times per spreadsheet without thinking about it.
The keyboard equivalent is Alt+H+O+I (for AutoFit Column Width) or Alt+H+O+A (for AutoFit Row Height). These are sequential keystrokes through the ribbon: Alt opens the ribbon shortcut overlay, H goes to Home tab, O opens Format menu, I or A picks the AutoFit option. Slower than the double-click for single columns but faster for multi-column AutoFits where you've already selected the range you want to resize. Both methods produce identical results and which one you use is purely habit preference.
One important conceptual note: AutoFit makes the column wide enough to fit the current content, then stops adjusting. New content added to the column won't automatically widen the column unless you AutoFit again. This catches users who AutoFit before entering all their data, then notice some cells truncated after entry. The fix is to AutoFit again at the end. There's no setting to keep a column AutoFitting continuously โ Excel doesn't have a true "AutoFit always on" mode, only a one-shot AutoFit operation that resizes once each time invoked manually or via macro.
Fastest method: double-click the right edge of the column header letter (A, B, C). Keyboard: Alt+H+O+I for AutoFit Column Width, Alt+H+O+A for AutoFit Row Height. Multiple columns: select all the columns first, then double-click any selected column boundary or use the keyboard shortcut. Entire sheet: press Ctrl+A to select all, then double-click any column boundary. Limitation: doesn't work as expected on merged cells or hidden columns.
The fastest way to AutoFit a single column is to double-click on the right boundary of the column header. Move your mouse to the line between two column letters at the top of the worksheet. The cursor changes to a vertical bar with horizontal arrows. Double-click. Excel resizes the left column to fit its widest content. The column on the right stays where it is. To AutoFit multiple columns at once, select them first (click the first letter, hold Shift, click the last letter to select a range, or hold Ctrl to select non-adjacent columns), then double-click any selected boundary.
The same trick works for row heights. Hover over the bottom boundary of any row number until the cursor changes, then double-click. Excel resizes that row to fit the tallest content visible in it. Useful when cells contain wrapped text and the row height got out of sync with the wrapped content. As with columns, you can select multiple rows first and AutoFit them all simultaneously by double-clicking any selected row boundary.
To AutoFit every column on a worksheet at once, select all cells with Ctrl+A (or click the gray rectangle in the top-left corner of the grid), then double-click any column boundary. Excel resizes every column on the sheet to fit its content. Combined with selecting all and AutoFitting rows the same way, you can clean up an entire spreadsheet's column widths and row heights in two operations totalling about five seconds. This is the single biggest time-saver in everyday Excel cleanup work.
One nuance: Ctrl+A behaves differently depending on the active cell. If your active cell is inside a data range, Ctrl+A selects the range. Press Ctrl+A again to extend selection to the entire sheet. Or click the gray rectangle in the top-left corner of the grid to go straight to selecting all cells in one click. Either way produces the same effect for AutoFit. Both shortcuts are useful to know because some workflows benefit from selecting the data range first, others from selecting all cells at once.
The fastest method. Hover over the right edge of any column letter (A, B, C) until the cursor changes, then double-click. The column resizes to fit its widest content. Works on a single column or on multi-column selections. Most everyday Excel users do this dozens of times per session without thinking about it. The mouse-based method is faster for individual columns than keyboard alternatives.
Click any cell in the column you want to fit. On the Home tab, click Format in the Cells group. Choose AutoFit Column Width or AutoFit Row Height from the dropdown. The ribbon-based method is slightly slower than the double-click but useful when teaching Excel to others or when you don't want to take your hands off the mouse to use keyboard shortcuts during the operation.
Sequential keystrokes through the ribbon: Alt opens the ribbon shortcut overlay, H goes to Home, O opens Format menu, I picks AutoFit Column Width (A picks AutoFit Row Height). Faster than the mouse for keyboard-driven workflows. Combined with multi-column selection, lets you AutoFit a range without taking hands off the keyboard during data entry or analysis.
Right-click the column letter, then choose Column Width and enter a specific value (in characters). Not technically AutoFit but useful when you want to set a manual width that overrides AutoFit. Default Excel column width is 8.43 characters. Setting an explicit width preserves it across data changes that would otherwise trigger AutoFit-style resizing on the column being managed manually.
For programmatic AutoFit. <code>Range("A:Z").EntireColumn.AutoFit</code> resizes every column from A to Z to fit content. Useful in macros that produce reports needing automatic cleanup at the end. Pair with <code>Range("1:100").EntireRow.AutoFit</code> to handle row heights. Always run AutoFit at the end of a macro after all data has been written, not at the start.
Power Query loaded data automatically arrives in a Table format that respects column widths from previous formatting. External BI tools (Tableau, Power BI) handle their own column sizing rules. AutoFit is purely an Excel-native operation; it doesn't transfer cleanly to other tools. Most users only need the Excel methods unless they're building cross-tool reporting workflows.
Every method that works for column widths also works for row heights. Double-click the bottom boundary of a row number to AutoFit that row to fit its tallest content. Select multiple rows first to AutoFit them all together. Use Alt+H+O+A as the keyboard equivalent. The behavior is symmetrical between rows and columns; once you know one, you know the other. The most common reason to AutoFit row heights is when wrapped text in cells has caused some rows to need more vertical space than they currently have allocated.
One row-specific gotcha: if you've manually set a row height previously, AutoFit may not always restore the row to the optimal height. Excel sometimes preserves the manual override even after AutoFit. The fix is to right-click the row number, choose Row Height, and set the value back to a default like 15 (the typical default in points), then AutoFit. The two-step reset clears the manual override before AutoFit runs again, producing the right size for the actual content this time.
For sheets with a mix of single-line and wrapped-text rows, AutoFit row heights produces inconsistent visual rhythm โ some rows tall, some short. Many users prefer to set a uniform row height manually for printable reports rather than letting AutoFit produce ragged heights. The choice depends on whether the priority is content visibility (AutoFit wins) or visual consistency (manual height wins) when looking at the resulting output. There's no objectively right answer; it's a presentation preference for the specific use case.
For very large spreadsheets, AutoFit row heights on every row can be slow because Excel evaluates each row's content individually. The same operation on columns is usually faster. If row-AutoFit performance becomes an issue (mostly with sheets over 50,000 rows), consider AutoFitting only the visible or relevant rows rather than the entire sheet. The mouse-double-click method is fastest for small selections; for very large sheets, a VBA macro that AutoFits in batches typically performs better than ribbon-driven operations on the whole sheet at once.
AutoFit doesn't work cleanly on columns containing merged cells. Excel doesn't know how to size a column whose content spans multiple columns. The result is usually a column width that doesn't reflect the merged content โ sometimes too narrow, sometimes wider than expected. Workaround: AutoFit the columns before merging, or unmerge cells, AutoFit, then re-merge. Better still, avoid merged cells in data ranges and use Center Across Selection from Format Cells for similar visual effect without the merge.
Wrapped text complicates AutoFit because the column doesn't need to be wide enough for the longest unwrapped value. AutoFit on a column with wrapped text typically produces a narrow column with tall rows. AutoFit row heights on the same column produces rows tall enough to display all wrapped lines. The combination of the two AutoFit operations produces clean wrapped-text columns. Run column AutoFit first, then row AutoFit to get the best visual result.
AutoFit doesn't expand hidden columns or rows. If column C is hidden and you double-click its boundary in the AutoFit gesture, Excel may unhide it inadvertently or behave unpredictably. Cleanest approach: unhide all columns and rows before AutoFit operations. Right-click any column letter and choose Unhide All if needed. After AutoFit, you can re-hide any columns that should stay hidden in the final output, preserving widths set by AutoFit on visible columns.
AutoFit on filtered Excel Tables only fits to visible content, not to all hidden filtered-out rows. If you AutoFit while a filter is active, the column width reflects only the values currently visible, not all values in the underlying data. Re-AutoFit after clearing the filter for column widths that fit the full data set. This is sometimes desirable (showing widest filtered subset) and sometimes not (varying widths between filter states).
Custom number formats (like leading zeros, scientific notation, or currency) affect what AutoFit measures. The displayed length matters, not the underlying numeric value. A cell with 100,000 displayed in scientific notation as 1.00E+05 fits in fewer characters than the unformatted value. Apply your final number formatting before running AutoFit so the column widths match the actual displayed content rather than the underlying values being formatted differently.
If you find yourself constantly resetting column widths to a specific value, you can set a different default. Click any column letter to select that column. Right-click and choose Column Width. The dialog opens showing the current width. Enter the value you want and click OK. The change applies to that one column, not as a new global default. To change the default for the entire worksheet, click any cell, then on the Home tab click Format โ Default Width, and enter your preferred default. The new default applies to all columns that haven't been manually resized.
The default-width setting only affects columns that haven't been individually customized. Columns you've already AutoFit or manually resized keep their existing widths. The setting matters more for blank or template worksheets where the new default takes effect immediately. For populated worksheets, the cleanest reset is to select all columns (Ctrl+A then click any column header), choose Column Width from the right-click menu, set the value, then re-AutoFit afterward. The two-step process produces a uniform baseline that AutoFit can adjust selectively.
Excel doesn't have a built-in option to set defaults for new workbooks beyond the workbook itself. To enforce a custom default column width across all new workbooks, save a custom workbook template (.xltx) with your preferred defaults applied, then set Excel to use that template as the default for new workbooks. File โ Options โ General โ "At startup, open all files in" lets you point Excel at a template folder. This is more setup than most users need but worthwhile for highly standardised workflows.
Worth knowing: Excel's default column width is 8.43 characters, which corresponds to roughly 64 pixels at 100% zoom on most displays. The character measurement is based on the default font (Calibri 11pt typically), so changing the default font also subtly changes the apparent column width even when the character count stays the same. If you're noticing inconsistent widths between workbooks, check whether the font has changed โ that's often the culprit rather than any explicit width difference between worksheets being compared side by side.
AutoFit is great for everyday cleanup, but several scenarios call for explicit width control instead. Printed reports often benefit from uniform column widths that fit a page consistently rather than ragged AutoFit widths. Set a standard width manually for printed output and accept that some content may be slightly truncated visually (still readable when printed at the right zoom). Sheet headers, page footers, and print-area framing all look more professional with consistent column widths.
Numerical precision matters in some contexts. AutoFit shows numbers wide enough to display in their current format. If you've formatted to 2 decimal places, AutoFit fits 2 decimals. If the underlying data has more precision and you later change the format to 4 decimals, the column may need to widen โ but you have to re-AutoFit. For columns where decimal precision will vary, set a fixed wider width that accommodates the maximum precision you'll ever use.
Presentation slides and screenshots often look better with wider, more relaxed column widths than AutoFit produces. AutoFit's tight fit can feel cramped in a screenshot embedded in a slide deck. Adding 2-3 characters of padding by setting widths manually produces cleaner-looking output. Some companies have style guides that specify column-width conventions for reports โ follow them rather than relying on AutoFit if your work will be widely circulated to executives or external audiences regularly.
Comparison across worksheets works best when matching columns have matching widths. Two sheets that should show side-by-side data look ragged if AutoFit produces different widths on each sheet. Set explicit widths consistent across both sheets when this is the case. The same logic applies to dashboards spanning multiple tabs that need to feel like a coherent set rather than disconnected spreadsheets each AutoFit to its own data.
One workflow tip worth mentioning: many Excel power users build AutoFit into recorded macros at the end of any data-generating routine. The pattern looks like: macro generates the report, then runs ActiveSheet.UsedRange.EntireColumn.AutoFit as the final step. The single line of VBA produces a polished output every time without manual cleanup. If you build reports regularly, take five minutes to record a macro that wraps your usual flow and ends with AutoFit. The investment pays back across every report you generate from that point forward.
For repeatable automation, VBA's AutoFit method is straightforward. The pattern is Range("A:Z").EntireColumn.AutoFit to AutoFit columns A through Z, or Range("1:100").EntireRow.AutoFit to AutoFit rows 1 through 100. The most common pattern is ActiveSheet.UsedRange.EntireColumn.AutoFit, which AutoFits every column containing data on the active sheet. Used range is the bounding box of all cells with content or formatting; AutoFit on that range covers everything you'd typically want sized correctly.
For workbooks with many sheets, loop through each sheet and AutoFit. The pattern: For Each ws In Worksheets: ws.UsedRange.EntireColumn.AutoFit: Next ws. The loop visits every worksheet and AutoFits its columns. Combined with row AutoFit (replace EntireColumn with EntireRow), the macro produces clean output across the whole workbook in one operation. Save the macro in your Personal Macro Workbook so it's available across every workbook you open without copying the code each time.
For more controlled AutoFit, you can pre-set the columns where you want a fixed width and AutoFit only the rest. The pattern: set explicit ColumnWidth values for specific columns, then AutoFit on the remainder. Example: Range("A:A").ColumnWidth = 30: Range("B:Z").EntireColumn.AutoFit. Column A stays at width 30 (perhaps for a long description column you don't want too narrow), while B through Z AutoFit to their content. The mixed approach gives you the speed of AutoFit with the control of explicit widths where it matters.
One caveat: VBA AutoFit can be slow on very large data sets because Excel evaluates each cell to determine the maximum width. For sheets with millions of cells, AutoFit can take many seconds. The optimisation pattern is to disable screen updating and automatic calculation during the AutoFit, then re-enable both afterward. The pattern: Application.ScreenUpdating = False: ... AutoFit code ... : Application.ScreenUpdating = True. The macro completes faster because Excel doesn't redraw the screen between each column resize during the operation.
Single column or small range, working in a worksheet you're actively editing. Hover over the right edge of the column letter, double-click, done. The fastest method for everyday cleanup. Most experienced Excel users default to this method dozens of times per spreadsheet without conscious thought during normal data work.
When you want to AutoFit every column at once on a sheet with many columns. Ctrl+A selects all, then double-clicking any column boundary AutoFits all columns simultaneously. Combine with the same operation on rows for full sheet cleanup in seconds. Excellent at the end of a build-and-tidy workflow on any new spreadsheet you're preparing.
When your hands are already on the keyboard and you don't want to switch to the mouse. The keyboard sequence works on any single cell or selected range. Slower than the double-click for mouse-driven users but faster for keyboard purists who prefer to stay on keys throughout their workflow without unnecessary mouse interruptions.
When you generate the same report regularly and want AutoFit baked in. A single line of VBA at the end of your macro (UsedRange.EntireColumn.AutoFit) produces polished output every time. Combined with screen-updating disabled during the operation, the AutoFit runs invisibly and quickly without slowing down the user-facing experience of running the macro on a regular basis.
The most common AutoFit problem is data added after AutoFit. You AutoFit a column, then enter new wider content, and the column doesn't expand automatically. The fix is to re-AutoFit at the end. Excel doesn't have a continuous-AutoFit mode. If you find yourself running AutoFit repeatedly through a data-entry session, consider AutoFitting once at the end rather than continuously. The data-entry experience is smoother when columns aren't constantly resizing as you type new values into the cells of the worksheet you're working in.
The second-most-common problem is AutoFit not working on merged cells. Excel doesn't know how to fit columns whose content spans multiple columns through a merge. Workarounds: unmerge the cells, AutoFit, then re-merge if needed. Or avoid merging entirely and use Center Across Selection (Format Cells โ Alignment โ Horizontal โ Center Across Selection) for similar visual effect without the AutoFit interference. Center Across Selection is generally a better practice than merging anyway because it preserves data manipulation and doesn't break sorting, filtering, or copy-paste operations.
The third issue is AutoFit producing inconsistent widths between sheets that should look identical. AutoFit fits to actual content, so any difference in content between sheets produces different widths. The fix is to set explicit ColumnWidth values on sheets that need to match each other rather than relying on AutoFit per sheet. The discipline pays off for dashboards and multi-sheet reports where visual consistency matters as much as content visibility within each individual sheet across the workbook view.
The fourth issue is performance on very large sheets. AutoFit on a sheet with millions of cells can take many seconds. The optimisation is to AutoFit specific column ranges rather than the entire sheet, or to AutoFit during a maintenance window when the user isn't waiting on the result. For VBA-driven AutoFit, disable ScreenUpdating during the operation to speed it up substantially. Most everyday spreadsheets are small enough that AutoFit is instantaneous; only the very large sheets need optimisation tricks.