{"id":64567,"date":"2025-05-12T10:29:32","date_gmt":"2025-05-12T07:29:32","guid":{"rendered":"https:\/\/wpcalc.com\/en\/?p=64567"},"modified":"2026-09-28T10:14:52","modified_gmt":"2026-09-28T07:14:52","slug":"reverse-list","status":"publish","type":"post","link":"https:\/\/wpcalc.com\/en\/web-tools\/reverse-list\/","title":{"rendered":"Reverse List"},"content":{"rendered":"<section class=\"not-prose calculator-box\" aria-labelledby=\"calculator-title\"><div class=\"flex items-baseline sm:items-center justify-between gap-2 sm:gap-3\"><div class=\"flex flex-col sm:flex-row sm:items-center gap-2\"><span class=\"icon icon-calculator text-primary-700! text-base! dark:text-primary-300!\" aria-hidden=\"true\"><\/span><h2 id=\"calculator-title\" class=\"text-lg font-display font-bold\">Line-by-Line List Reverser Tool<\/h2><\/div><div class=\"calcdash-favorite group\">\n  <button type=\"button\" class=\"favorite\" id=\"favorite\" data-favorite-id=\"64567\" data-favorite-title=\"Reverse List\" data-favorite-url=\"https:\/\/wpcalc.com\/en\/web-tools\/reverse-list\/\" data-favorite-excerpt=\"Reverse the order of items in a list. Paste items into List and choose whether they are separated by new lines, spaces, semicolons, dashes, pipes, or commas.\" aria-label=\"Add to Favorites\" data-favorite-icon=\"icon icon-d-edit\">\n    <span class=\"icon icon-shape-star-empty\" aria-hidden=\"true\"><\/span>\n  <\/button>\n  <div class=\"calcdash-favorite__tip\" aria-hidden=\"true\">\n   <span class=\"favorite-tooltip\" id=\"favorite-tooltip\"><\/span>\n  <\/div>\n  <span class=\"sr-only\" role=\"status\" id=\"favorite-status\"><\/span>\n<\/div><\/div><form action=\"https:\/\/wpcalc.com\/en\/web-tools\/reverse-list\/\" method=\"POST\" class=\"calculator\" id=\"calculator-64567\" data-post=\"64567\"><fieldset class=\"fieldset-input is-1\"><legend class=\"sr-only\">Input Fields<\/legend><div class=\"field is-single\" id=\"input-1\"><label for=\"field-1\">List<\/label><textarea id=\"field-1\" name=\"list\">Apple\nBanana\nOrange<\/textarea><\/div><div class=\"field\" id=\"input-2\"><label for=\"field-2\">Separator<\/label><div class=\"grid grid-cols-1\"><select id=\"field-2\" name=\"separator\"><option value=\"1\">New line<\/option><option value=\"2\">Space<\/option><option value=\"3\">;<\/option><option value=\"4\">-<\/option><option value=\"5\">|<\/option><option value=\"6\">,<\/option><\/select><svg class=\"pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end text-gray-500 sm:size-4\" viewBox=\"0 0 16 16\" fill=\"currentColor\" aria-hidden=\"true\" data-slot=\"icon\">\n              <path fill-rule=\"evenodd\" d=\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\" clip-rule=\"evenodd\" \/>\n            <\/svg><\/div><\/div><\/fieldset><div class=\"buttons\"><button type=\"submit\" data-text=\"Re-Calculate\" id=\"calculate-button\" data-post=\"64567\">Calculate<\/button><button type=\"reset\">Reset<\/button><\/div><div class=\"field is-checkbox hidden!\" id=\"field-auto-calc\"><input type=\"checkbox\" id=\"auto-calc\"><label for=\"auto-calc\">Calculate automatically<\/label><small>If enabled, the result will update automatically when you change any value.<\/small><\/div><div class=\"fieldset-result is-hidden\" aria-labelledby=\"result-title\" aria-live=\"polite\" role=\"region\"> <h3 class=\"result-title bg-gradient-to-r from-primary-50 to-gray-50 dark:from-primary-900 dark:to-gray-800\" id=\"result-title\"><span class=\"icon icon-s-pulse\" aria-hidden=\"true\"><\/span> Your Results<\/h3><div class=\"result-box\"><div class=\"field-result is-column\" id=\"output-1\"><span class=\"field-title\"><span>Reversed List<\/span><\/span><span class=\"field-value\" id=\"result-1\"><\/span><button type=\"button\" class=\"copy-result\" data-tooltip=\"Copy Result\" aria-label=\"Copy Result\"><span class=\"copy-icon icon icon-document-copy\" aria-hidden=\"true\"><\/span><\/button><\/div><\/div><div class=\"result-actions\"><button type=\"button\" class=\"copy-link\"><svg viewBox=\"0 0 20 20\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M12.232 4.232a2.5 2.5 0 0 1 3.536 3.536l-1.225 1.224a.75.75 0 0 0 1.061 1.06l1.224-1.224a4 4 0 0 0-5.656-5.656l-3 3a4 4 0 0 0 .225 5.865.75.75 0 0 0 .977-1.138 2.5 2.5 0 0 1-.142-3.667l3-3Z\"\/><path d=\"M11.603 7.963a.75.75 0 0 0-.977 1.138 2.5 2.5 0 0 1 .142 3.667l-3 3a2.5 2.5 0 0 1-3.536-3.536l1.225-1.224a.75.75 0 0 0-1.061-1.06l-1.224 1.224a4 4 0 1 0 5.656 5.656l3-3a4 4 0 0 0-.225-5.865Z\"\/><\/svg><span class=\"copy-link__text\">Copy link to this calculation<\/span><\/button><span class=\"sr-only\" role=\"status\" id=\"copy-link-status\"><\/span><\/div><\/div><a href=\"#respond\" class=\"hidden transition-opacity duration-300 opacity-0 w-50 text-sm justify-center items-center gap-2 px-4 py-2 rounded bg-gray-200 text-gray-700 hover:bg-gray-300\" id=\"leave-comment\"><span class=\"icon icon-comments\" aria-hidden=\"true\"><\/span>Leave a Comment<\/a><\/form><\/section><section id=\"calc-reactions\" class=\"not-prose hidden my-12 bg-gradient-to-r from-primary-50 to-gray-50 border border-indigo-100 rounded-xl px-6 py-4 shadow-sm\" data-post=\"64567\" aria-live=\"polite\" aria-labelledby=\"calc-reactions-title\"><p id=\"calc-reactions-title\" class=\"text-sm text-gray-500 text-center mb-2\">How did this result make you feel?<\/p><div role=\"group\" aria-labelledby=\"calc-reactions-title\" class=\"grid grid-cols-3 sm:flex sm:flex-row sm:justify-around gap-4 sm:items-center sm:flex-wrap\"><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"like\"><span class=\"reaction-count\" data-reaction-count=\"like\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude00 <\/span><span class=\"reaction-description font-medium\">Like <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"helpful\"><span class=\"reaction-count\" data-reaction-count=\"helpful\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\udca1 <\/span><span class=\"reaction-description font-medium\">Helpful <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"confused\"><span class=\"reaction-count\" data-reaction-count=\"confused\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude15 <\/span><span class=\"reaction-description font-medium\">Confused <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"disappointed\"><span class=\"reaction-count\" data-reaction-count=\"disappointed\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\ud83d\ude1e <\/span><span class=\"reaction-description font-medium\">Disappointed <\/span><\/button><button type=\"button\" aria-pressed=\"false\" class=\"reaction-btn flex flex-col items-center gap-1 text-sm text-gray-700 hover:text-primary-600 cursor-pointer transition-transform hover:scale-105\" data-reaction=\"inaccurate\"><span class=\"reaction-count\" data-reaction-count=\"inaccurate\">0<\/span><span class=\"reaction text-3xl\" aria-hidden=\"true\">\u274c <\/span><span class=\"reaction-description font-medium\">Inaccurate <\/span><\/button><\/div><div id=\"reaction-message\" class=\"hidden mt-8 rounded-md border border-primary-100 bg-white\/50 backdrop-blur-sm px-4 py-2 text-sm text-center shadow-sm\"><\/div><\/section><div class=\"calcdash-ad not-prose calcdash-ad--calc_result calcdash-ad--in-article\"><ins class=\"adsbygoogle\" style=\"display:block\" data-ad-client=\"ca-pub-1721569815777345\" data-ad-slot=\"6317458308\" data-ad-layout=\"in-article\" data-ad-format=\"fluid\"><\/ins><script>(adsbygoogle = window.adsbygoogle || []).push({});<\/script><\/div>\n<style id=\"wpcoderpro-inline-1\">.formula-box {\r\n\tborder-bottom: none !important;\r\n}<\/style><section class=\"formula-box\" aria-labelledby=\"formula-title\">\r\n\t<div id=\"formula-title\" class=\"not-prose font-display mb-4\"><span class=\"icon icon-formula\" aria-hidden=\"true\"><\/span><h2>Reverse List Formula<\/h2><\/div>\r\n\t<figure class=\"not-prose formula\">\r\n\t\t<figcaption class=\"formula-title\">Formula<\/figcaption>\r\n\t\t<div class=\"text-base text-gray-800\" id=\"formula\">\n\\[ (a_1,\\ldots,a_n)=\\operatorname{nonempty}\\!\\left(\\operatorname{trimEach}\\!\\left(\\operatorname{split}_{s}(\\operatorname{trim}(L))\\right)\\right),\\qquad R=\\operatorname{join}_{s}(a_n,a_{n-1},\\ldots,a_1) \\]\n<\/div>\r\n\t<\/figure>\r\n\t<\/p>\n<p><strong>Where:<\/strong><\/p>\n<ul>\n<li>\\(L\\) \u2014 the text entered in List.<\/li>\n<li>\\(s\\) \u2014 the selected separator.<\/li>\n<li>\\(a_1,\\ldots,a_n\\) \u2014 the nonempty items after splitting and trimming.<\/li>\n<li>\\(R\\) \u2014 the reversed list.<\/li>\n<\/ul>\n<p>The tool trims the input and each item, removes empty items, reverses the remaining items, and joins them using the selected separator. It changes item order, not the characters within each item.<\/p>\n<p>\r\n<\/section>\n<style id=\"wpcoderpro-inline-459\">.calculation-box {\r\n\tborder-bottom: none !important;\r\n}<\/style><section id=\"calculation\" class=\"calculation-box\" aria-labelledby=\"calculation-title\">\r\n\t<div id=\"calculation-title\" class=\"not-prose font-display\"><span class=\"icon icon-unordered-list\" aria-hidden=\"true\"><\/span><h2>Reverse List \u2013 Calculation Example<\/h2><\/div>\r\n\r\n<\/p>\n<p><strong>Example:<\/strong> leave the default Apple, Banana, and Orange on separate lines in List, with Separator set to New line.<\/p>\n<p>\\[ [\\text{Apple},\\text{Banana},\\text{Orange}]\\xrightarrow{\\text{reverse}}[\\text{Orange},\\text{Banana},\\text{Apple}] \\]<\/p>\n<p><strong>Result:<\/strong> Orange, Banana, Apple, displayed on separate lines in Reversed List.<\/p>\n<p>\n\r\n<\/section>\n<h2>How to use the Reverse List calculator<\/h2>\n<ol>\n<li>Enter or paste your items into <strong>List<\/strong>. For the default setting, put one item on each line.<\/li>\n<li>Choose <strong>Separator<\/strong> to match the character between items: New line, Space, ;, -, |, or ,.<\/li>\n<li>Read the items in <strong>Reversed List<\/strong>. They appear in the opposite order, with the chosen separator between them. Use the result\u2019s copy option if you need the output elsewhere.<\/li>\n<\/ol>\n<p>Match Separator to the text you entered. For example, to reverse <code>red,green,blue<\/code> as three items, select the comma option. If you leave New line selected, that entire line is treated as one item and its contents remain unchanged.<\/p>\n<h2>What reversing a list means<\/h2>\n<p>List reversal places the last item first, the second-to-last item second, and so on until the original first item becomes last. It does not sort the list. If the original order is Monday, Friday, Wednesday, the result is Wednesday, Friday, Monday\u2014not alphabetical or chronological order. To arrange items alphabetically instead, use the <a href=\"https:\/\/wpcalc.com\/en\/web-tools\/list-alphabetizer\/\">List Alphabetizer<\/a>.<\/p>\n<p>Reversal is useful when the sequence itself matters. You might have notes recorded from oldest to newest and want to read them newest first, or need to invert a checklist before pasting it into another document. The tool leaves the text of each retained item intact apart from removing whitespace at its edges. It does not reverse the letters of a word; the <a href=\"https:\/\/wpcalc.com\/en\/web-tools\/reverse-letters\/\">Reverse Letters<\/a> tool is for that different task.<\/p>\n<p>The number of items in the result is the number of nonempty items found after splitting and trimming. Repeated items remain repeated: reversing <code>A,B,A<\/code> still produces <code>A,B,A<\/code>. For a less predictable arrangement rather than the exact opposite order, use the <a href=\"https:\/\/wpcalc.com\/en\/web-tools\/list-randomizer\/\">List Randomizer<\/a>.<\/p>\n<h2>Separators and practical limitations<\/h2>\n<p><strong>New line<\/strong> splits at line breaks and displays the result one item per line. <strong>Space<\/strong> splits at runs of whitespace, including tabs and line breaks; it is best for a list of single words, not phrases containing spaces. The semicolon, dash, pipe, and comma choices split at each occurrence of that character and display the reversed items with the same type of separator.<\/p>\n<p>A selected character is treated as a separator wherever it occurs, even inside text you intended to keep together. For example, with dash selected, <code>well-being<\/code> becomes two items. With comma selected, a comma inside an item also creates a split. This is a simple text splitter, not a CSV parser: quotation marks do not protect commas inside quoted fields. Choose a separator that does not occur within your items, or prepare the input before reversing it.<\/p>\n<p>Whitespace at the beginning and end of the full input and of each item is removed, and items containing only whitespace are omitted. This means blank lines or consecutive delimiters do not become blank items in the result. If you need to preserve intentional empty entries, spacing around items, or a more complex delimiter, this tool will not reproduce those details. Check the output before using it for structured data or commands where exact formatting matters.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Reverse the order of items in a list. Paste items into List and choose whether they are separated by new lines, spaces, semicolons, dashes, pipes, or commas.<\/p>\n","protected":false},"author":70,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[63],"tags":[65],"class_list":["post-64567","post","type-post","status-publish","format-standard","hentry","category-web-tools","tag-text-tools"],"acf":[],"_links":{"self":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/64567","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/users\/70"}],"replies":[{"embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/comments?post=64567"}],"version-history":[{"count":3,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/64567\/revisions"}],"predecessor-version":[{"id":65344,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/posts\/64567\/revisions\/65344"}],"wp:attachment":[{"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/media?parent=64567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/categories?post=64567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpcalc.com\/en\/wp-json\/wp\/v2\/tags?post=64567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}