How to Add a Line in an Excel Cell: Line Breaks, Borders, and Underlines Explained
Learn how to add a line in excel cell using Alt+Enter, CHAR(10), borders, and underlines. Step-by-step methods for Windows, Mac, and Excel Online.

Learning how to add a line in excel cell is one of those small skills that separates polished spreadsheets from cluttered, hard-to-read ones. Whether you need a line break inside a single cell, a horizontal border between rows, or an underline beneath text, Excel offers multiple methods to control exactly how your data is displayed. Most users only know one approach, but mastering all of them transforms how quickly you can format reports, invoices, and dashboards without resorting to workarounds or external tools.
The most common interpretation of adding a line inside a cell is inserting a line break within the same cell. On Windows, the shortcut is Alt+Enter; on Mac, it is Control+Option+Return. This wraps text onto a new line without spilling into adjacent cells, which is essential for addresses, multi-line headers, or formatted notes. Excel automatically increases row height to accommodate the new lines, though you may need to adjust column width to display everything clearly.
Beyond manual line breaks, formulas like CHAR(10) and CHAR(13) let you concatenate text with line breaks programmatically. This is powerful when you need dynamic content combined from several columns, such as building mailing labels or stitching together a customer record. Pair CHAR(10) with the TEXTJOIN or CONCAT function and enable Wrap Text on the destination cell to see the breaks render properly instead of appearing as little square boxes.
Adding a horizontal line between rows is a different problem entirely. Here, you are working with borders rather than text. Excel's Borders menu sits on the Home tab and offers thin lines, thick lines, double lines, and dashed lines that you can apply to any edge of a cell. Borders are purely visual; they do not affect calculations, sorting, or filtering, but they dramatically improve readability when used sparingly to separate sections of a report.
Sometimes users actually want an underline beneath specific text inside a cell. This is handled through the Font group on the Home tab with the Underline button (Ctrl+U on Windows, Command+U on Mac). Excel also offers Double Underline, Single Accounting, and Double Accounting underline styles, the last two being especially useful for financial statements where the underline must extend across the full column width regardless of where the number ends.
Finally, some users searching for this topic want to draw an actual line shape on top of their worksheet. The Insert tab contains a Shapes gallery where you can draw straight lines, arrows, or connectors that float above the cells. These are useful for annotating dashboards or pointing out trends in charts, but remember that shapes do not move with cell content unless you change their anchoring properties. Each of these techniques solves a different problem, and choosing the right one saves hours of frustration.
This guide walks through every method in detail, with shortcuts for both Windows and Mac, formula examples, and troubleshooting tips for when line breaks refuse to display. By the end, you will know exactly which technique to reach for whether you are formatting a quick note, building a dynamic report, or designing a printable invoice that needs to look professional on paper.
Excel Line Formatting by the Numbers

How to Add a Line Break in an Excel Cell — Step by Step
Click into the Cell
Position the Cursor
Press the Shortcut
Enable Wrap Text
Adjust Row Height
Press Enter to Confirm
While keyboard shortcuts work perfectly for one-off edits, formulas are the answer when you need line breaks generated automatically across hundreds or thousands of cells. The CHAR function returns a character based on its ASCII code, and CHAR(10) specifically returns a line feed character — the same character inserted by Alt+Enter. By concatenating CHAR(10) between pieces of text, you can build multi-line cells dynamically from data already in your workbook, which is enormously useful for reports.
The simplest example combines a first name, last name, and email address into a single contact card cell. The formula would be =A2 & CHAR(10) & B2 & CHAR(10) & C2. After entering this formula, the result may appear as one long string with little boxes where the line breaks should be. The fix is to select the cell and click Wrap Text on the Home tab. Excel will then render the CHAR(10) characters as actual line breaks instead of literal symbols.
For more sophisticated joins, the TEXTJOIN function introduced in Excel 2016 makes life significantly easier. TEXTJOIN takes a delimiter, an option to ignore empty values, and a range of cells to combine. Writing =TEXTJOIN(CHAR(10), TRUE, A2:A5) joins everything in A2 through A5 with a line break between each entry, skipping blanks automatically. This is far cleaner than chaining a dozen ampersands and CHAR(10) calls, and it scales effortlessly when your data grows.
On Mac versions of Excel, you may need to use CHAR(13) instead of CHAR(10) for compatibility, although modern Excel for Mac generally accepts both. If your line breaks are not working on a colleague's machine across platforms, swapping CHAR(10) for CHAR(13) or using both with CHAR(13) & CHAR(10) often resolves the inconsistency. This dual approach mimics how Windows handles line endings in plain text files, with a carriage return followed by a line feed.
CHAR(10) also plays nicely with conditional logic. You can wrap it inside an IF statement so a line break only appears when certain conditions are met. For example, =A2 & IF(B2<>"", CHAR(10) & B2, "") appends a second line only if cell B2 contains data. This prevents awkward blank lines from appearing in records with missing fields, keeping your output tidy regardless of data completeness in the source range.
If you ever need to remove line breaks rather than add them, the SUBSTITUTE function inverts the process. The formula =SUBSTITUTE(A2, CHAR(10), " ") replaces every line break in cell A2 with a single space, flattening the content back to a single line. This is invaluable when importing data from PDFs, web pages, or other systems that introduce unwanted breaks that interfere with sorting, lookups like VLOOKUP, or downstream processing in pivot tables.
One subtle gotcha: formulas containing CHAR(10) work correctly when the cell has Wrap Text enabled, but they will not change the row height automatically the way Alt+Enter does. After applying a CHAR(10)-based formula, you typically need to select the affected rows, right-click, choose Row Height, and select AutoFit Row Height. Once that adjustment is made, the multi-line content displays exactly as intended, and the rows resize properly when content changes.
Line Break Methods Across Excel Versions
On Windows, Alt+Enter is the universal shortcut for inserting a line break inside any cell, and it works in Excel 2010, 2013, 2016, 2019, 2021, and Microsoft 365. You simply double-click the cell to enter edit mode, position your cursor, hold Alt, and press Enter. The row height adjusts automatically, and the cell content rewraps to fit your column width without requiring any additional menu clicks or settings changes for most users.
Windows users can also use CHAR(10) in formulas without any compatibility issues. Whether you are working with simple concatenation using the ampersand operator or building complex TEXTJOIN formulas pulling from dozens of source cells, the line feed character displays correctly as long as Wrap Text is enabled on the destination. This combination makes Windows arguably the smoothest environment for multi-line cell formatting across all Excel platforms available today.

Alt+Enter vs CHAR(10): Which Should You Use?
- +Alt+Enter is instant and requires no formulas or setup
- +CHAR(10) scales effortlessly across thousands of cells
- +CHAR(10) enables dynamic line breaks based on source data changes
- +Alt+Enter automatically expands row height without manual adjustment
- +CHAR(10) works seamlessly inside IF, TEXTJOIN, and CONCAT formulas
- +Alt+Enter is intuitive for non-technical users and quick edits
- −Alt+Enter requires editing each cell individually, which does not scale
- −CHAR(10) needs Wrap Text enabled to display line breaks correctly
- −Alt+Enter line breaks can be lost if the cell is overwritten by a formula
- −CHAR(10) does not auto-expand row height like manual breaks do
- −Alt+Enter shortcuts differ between Windows, Mac, and some browsers
- −CHAR(10) sometimes renders as a box symbol when shared cross-platform
Checklist: Adding Lines in Excel Cells the Right Way
- ✓Double-click the cell or press F2 to enter edit mode before pressing Alt+Enter
- ✓Enable Wrap Text on cells containing CHAR(10) so line breaks render visibly
- ✓Use Control+Option+Return on Mac instead of Alt+Enter for line breaks
- ✓Apply TEXTJOIN with CHAR(10) when combining multiple cells into one multi-line cell
- ✓AutoFit row height by double-clicking the row boundary after adding line breaks
- ✓Use the Borders menu on the Home tab to add horizontal lines between rows
- ✓Press Ctrl+U (Cmd+U on Mac) to underline selected text inside a cell
- ✓Use Insert > Shapes > Line to draw freehand lines over your worksheet
- ✓Test cross-platform compatibility by opening shared files on both Windows and Mac
- ✓Use SUBSTITUTE with CHAR(10) to remove unwanted line breaks from imported data
Always enable Wrap Text before relying on CHAR(10)
Line breaks added via CHAR(10) only display when Wrap Text is turned on for the cell. After enabling Wrap Text, select the row and choose Format > AutoFit Row Height to ensure all lines are visible. This two-step combo prevents the most common formatting frustration with multi-line Excel cells.
Beyond line breaks within cells, many users searching for how to add a line in excel cell are actually looking to draw a visible horizontal or vertical line in their spreadsheet. The most common solution is borders, accessed from the Borders dropdown in the Font group on the Home tab. Excel offers thirteen border styles including thin, medium, thick, double, and dashed lines, each of which can be applied to the top, bottom, left, right, or all edges of a cell or selection.
To add a single horizontal line between two rows, select the row where you want the line to appear, click the Borders dropdown, and choose Bottom Border. The line spans only the columns that contain data or are part of your selection, which is ideal for table headers, subtotal rows, or visual section breaks. If you want a line that stretches across the entire visible spreadsheet, select the full row by clicking its row number before applying the border style.
For more granular control, use the Format Cells dialog by pressing Ctrl+1 (Cmd+1 on Mac). The Border tab lets you choose line style, color, and which specific edges to draw on. You can mix and match — for example, a thick black line on top and a thin gray line on the bottom — which is common in financial reports where the top border of a totals row matches accounting conventions for summing columns of numbers cleanly.
Underlining text inside a cell is a separate feature from borders. Select the cell or specific text within a cell, then press Ctrl+U or click the Underline button in the Font group. Click the dropdown arrow next to Underline to access Double Underline. For accounting underlines that extend across the full column width regardless of text length, open Format Cells, go to the Font tab, and choose Single Accounting or Double Accounting from the Underline dropdown.
Drawing actual line shapes is yet another option. Go to the Insert tab, click Shapes, and pick a straight line, arrow, or connector from the Lines section. Click and drag on the worksheet to draw your line, then use the Shape Format tab to change color, weight, and style. Hold Shift while dragging to constrain the line to perfect horizontal, vertical, or 45-degree angles, which is essential for clean annotations on charts and dashboards.
Shapes float above cells by default and do not move when you sort or filter data. To anchor a shape so it moves with cells, right-click it, choose Size and Properties, expand Properties, and select Move and size with cells. This is critical when you are annotating specific data points or labeling regions of a report that may shift as the data grows or contracts over time across reporting periods.
Combining borders, underlines, and shapes thoughtfully creates spreadsheets that look professional and communicate clearly. The key is restraint: too many lines clutter the view and make data harder to scan. Use horizontal borders to separate major sections, use bottom borders or accounting underlines for totals, and reserve drawn shapes for genuine annotations rather than decoration. With these guidelines, your spreadsheets will rival the polish of professionally designed dashboards and printed reports.

Excel borders sometimes look bolder or thinner on screen than on paper. Always use Print Preview (Ctrl+P) before sending a report to confirm your lines render at the expected weight. Thin gray borders especially can disappear entirely when printed at lower resolutions or on draft-quality settings.
Troubleshooting line break issues usually comes down to one of three culprits: Wrap Text being disabled, row height being locked, or cross-platform character encoding mismatches. The first step when a line break refuses to display is selecting the problem cell and clicking Wrap Text in the Home tab Alignment group. If the button is already highlighted, click it off and on again to refresh the setting, then double-click the row boundary to force an AutoFit row height recalculation.
Row height issues are particularly common when a row was manually resized at some point in the past. Excel remembers that manual setting and refuses to AutoFit afterward unless you explicitly trigger it. Right-click the row number, choose Row Height, and either enter a specific value large enough for your content or close the dialog and double-click the row boundary instead. For multiple rows, select them all first, then double-click any of the selected row boundaries for batch resizing.
When sharing workbooks across operating systems, line breaks added with CHAR(10) on Windows occasionally appear as boxes or question marks on Mac, and vice versa. The fix is to standardize on CHAR(10) throughout and ensure every recipient has Wrap Text enabled on the affected cells. If problems persist, replace CHAR(10) with a combination of CHAR(13) and CHAR(10), which covers both Mac and Windows line ending conventions in a single formula.
Another common issue is line breaks disappearing after a copy-paste operation. When you paste from Word, Outlook, or a web browser, Excel sometimes converts line breaks into spaces or strips them entirely. The workaround is to paste into a single cell first using Ctrl+Shift+V and selecting Text Only, then manually re-add line breaks where needed, or use Find & Replace with Ctrl+J in the Find box to convert pasted text characters into proper line breaks.
If your goal is to add a line to separate sections rather than break text within a cell, remember that borders are far more print-friendly than drawn shapes. Borders scale automatically when columns resize, while shapes need manual repositioning. For a polished look, combine a thick bottom border under section headers with thin internal gridlines, and disable Excel's default gridlines from the View tab so only your intentional borders remain visible on screen and in print.
For users building templates that others will fill in, consider using cell styles to enforce consistent formatting. Create a custom style with Wrap Text enabled, a specific row height, and the border treatment you want, then apply that style with one click whenever you need a multi-line cell. This makes line break handling foolproof for less experienced colleagues and keeps your workbook formatting consistent across dozens or hundreds of sheets and contributors.
Finally, when working with very long multi-line content, consider whether a cell is really the right container. Excel cells have a 32,767 character limit, but practical readability tops out long before that. For lengthy notes, a Text Box from the Insert menu often serves better, giving you full word processing controls including font changes, bullet lists, and resizable boundaries that do not interfere with surrounding cell data, sorting, or filtering operations across your worksheet.
To put everything together, here are the practical workflows experienced Excel users follow when adding lines to cells in real-world scenarios. For quick one-off edits like fixing a single mailing address that should appear on three lines, just double-click the cell, position the cursor, and press Alt+Enter twice — once after the street, once after the city. Press Enter to confirm and move on. This takes about five seconds and requires no formulas, no menu navigation, and no formatting adjustments afterward.
For batch operations like generating contact cards for an entire customer list, build a TEXTJOIN formula in a helper column that combines name, address, phone, and email with CHAR(10) between each piece. Apply Wrap Text to the helper column, AutoFit the row heights, and the output is ready to copy into mail-merge tools or printed directory pages. If the source data changes, the line-broken output updates automatically, eliminating manual rework whenever a customer record is edited or new entries are added.
For invoices, financial statements, and other printable reports, lean on borders rather than line breaks within cells. Use a thick bottom border above totals, a thin border between line items, and a double bottom border under the grand total to match standard accounting conventions. Pair this with the Single Accounting underline style on currency cells for a finished look that reads cleanly both on screen and on printed pages, regardless of the data volume or report length.
When designing dashboards, mix techniques deliberately. Use Alt+Enter for stacked KPI labels in summary cells, borders to delineate dashboard sections, and Insert > Shapes > Line for callouts pointing to chart elements. Always anchor shapes to cells using the Move and size with cells option so your annotations stay in place as users filter, sort, or pivot the underlying data. This level of polish distinguishes amateur from professional Excel work in front of stakeholders.
For collaborative workbooks where multiple people edit the same cells, document your line break conventions in a hidden Notes sheet or a comment on the first row. New collaborators often type Enter instead of Alt+Enter and accidentally move to the next cell, losing their place. A quick note explaining the shortcut prevents confusion and keeps everyone consistent, especially in environments where Excel files are passed between team members with varying skill levels and platforms.
If you frequently work with CSV exports or data pasted from external systems, build a one-line cleanup formula using SUBSTITUTE to normalize line breaks immediately upon import. Wrapping your data in =SUBSTITUTE(SUBSTITUTE(A1, CHAR(13), ""), CHAR(10), " ") strips out unwanted breaks and replaces them with spaces in a single step. This is invaluable before running VLOOKUP, sorting, or any text-matching operation that gets tripped up by hidden control characters embedded in your data.
Finally, practice these techniques on a sample workbook before deploying them in production reports. Set up a test sheet with a few rows of dummy data, then try every method — Alt+Enter, CHAR(10), TEXTJOIN, borders, accounting underlines, and shapes. Once you have used each technique two or three times, the muscle memory sticks, and you will instinctively reach for the right approach in the moment. Mastering line formatting is a small skill with outsized impact on your Excel output quality.
Excel Questions and Answers
About the Author
Attorney & Bar Exam Preparation Specialist
Yale Law SchoolJames R. Hargrove is a practicing attorney and legal educator with a Juris Doctor from Yale Law School and an LLM in Constitutional Law. With over a decade of experience coaching bar exam candidates across multiple jurisdictions, he specializes in MBE strategy, state-specific essay preparation, and multistate performance test techniques.