diff --git a/core/modules/block_content/block_content.module b/core/modules/block_content/block_content.module
index 383cd57701..eec75c8b38 100644
--- a/core/modules/block_content/block_content.module
+++ b/core/modules/block_content/block_content.module
@@ -87,7 +87,10 @@ function block_content_add_body_field($block_type_id, $label = 'Body') {
       'field_storage' => FieldStorageConfig::loadByName('block_content', 'body'),
       'bundle' => $block_type_id,
       'label' => $label,
-      'settings' => ['display_summary' => FALSE],
+      'settings' => [
+        'display_summary' => FALSE,
+        'allowed_formats' => [],
+      ],
     ]);
     $field->save();
 
diff --git a/core/modules/block_content/migrations/block_content_body_field.yml b/core/modules/block_content/migrations/block_content_body_field.yml
index 9ed884f99e..bc30e0ff98 100644
--- a/core/modules/block_content/migrations/block_content_body_field.yml
+++ b/core/modules/block_content/migrations/block_content_body_field.yml
@@ -13,6 +13,7 @@ source:
       field_name: body
       label: Body
       display_summary: false
+      allowed_formats: {  }
   ids:
     entity_type:
       type: string
diff --git a/core/modules/book/config/optional/field.field.node.book.body.yml b/core/modules/book/config/optional/field.field.node.book.body.yml
index 7cf998dcf6..e45dcc27db 100644
--- a/core/modules/book/config/optional/field.field.node.book.body.yml
+++ b/core/modules/book/config/optional/field.field.node.book.body.yml
@@ -19,4 +19,5 @@ default_value_callback: ''
 settings:
   display_summary: true
   required_summary: false
+  allowed_formats: {  }
 field_type: text_with_summary
diff --git a/core/modules/ckeditor/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php b/core/modules/ckeditor/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
index 74c20abace..1403dfc5de 100644
--- a/core/modules/ckeditor/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
+++ b/core/modules/ckeditor/tests/src/FunctionalJavascript/CKEditorIntegrationTest.php
@@ -73,7 +73,10 @@ protected function setUp(): void {
       'field_storage' => $field_storage,
       'bundle' => 'page',
       'label' => 'Body',
-      'settings' => ['display_summary' => TRUE],
+      'settings' => [
+        'display_summary' => TRUE,
+        'allowed_formats' => [],
+      ],
       'required' => TRUE,
     ])->save();
 
diff --git a/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php b/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php
index edb5fc2fac..e955526155 100644
--- a/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php
+++ b/core/modules/config_translation/tests/src/Functional/ConfigTranslationListUiTest.php
@@ -409,7 +409,10 @@ public function doFieldListTest() {
       'field_storage' => FieldStorageConfig::loadByName('block_content', 'body'),
       'bundle' => $block_content_type->id(),
       'label' => 'Body',
-      'settings' => ['display_summary' => FALSE],
+      'settings' => [
+        'display_summary' => FALSE,
+        'allowed_formats' => [],
+      ],
     ]);
     $field->save();
 
diff --git a/core/modules/field/tests/modules/field_test_config/config/install/field.field.entity_test.entity_test.field_test_import.yml b/core/modules/field/tests/modules/field_test_config/config/install/field.field.entity_test.entity_test.field_test_import.yml
index 0cfd11a2c4..865b0a2751 100644
--- a/core/modules/field/tests/modules/field_test_config/config/install/field.field.entity_test.entity_test.field_test_import.yml
+++ b/core/modules/field/tests/modules/field_test_config/config/install/field.field.entity_test.entity_test.field_test_import.yml
@@ -8,7 +8,8 @@ description: ''
 required: false
 default_value: {  }
 default_value_callback: ''
-settings: { }
+settings:
+  allowed_formats: {  }
 field_type: text
 dependencies:
   config:
diff --git a/core/modules/field/tests/modules/field_test_config/config/install/field.field.entity_test.entity_test.field_test_import_2.yml b/core/modules/field/tests/modules/field_test_config/config/install/field.field.entity_test.entity_test.field_test_import_2.yml
index f73354f549..341794c7ba 100644
--- a/core/modules/field/tests/modules/field_test_config/config/install/field.field.entity_test.entity_test.field_test_import_2.yml
+++ b/core/modules/field/tests/modules/field_test_config/config/install/field.field.entity_test.entity_test.field_test_import_2.yml
@@ -8,7 +8,8 @@ description: ''
 required: false
 default_value: {  }
 default_value_callback: ''
-settings: { }
+settings:
+  allowed_formats: {  }
 field_type: text
 dependencies:
   config:
diff --git a/core/modules/field/tests/modules/field_test_config/config/install/field.field.entity_test.test_bundle.field_test_import_2.yml b/core/modules/field/tests/modules/field_test_config/config/install/field.field.entity_test.test_bundle.field_test_import_2.yml
index 75c856fa01..9129a7a750 100644
--- a/core/modules/field/tests/modules/field_test_config/config/install/field.field.entity_test.test_bundle.field_test_import_2.yml
+++ b/core/modules/field/tests/modules/field_test_config/config/install/field.field.entity_test.test_bundle.field_test_import_2.yml
@@ -8,7 +8,8 @@ description: ''
 required: false
 default_value: {  }
 default_value_callback: ''
-settings: { }
+settings:
+  allowed_formats: {  }
 field_type: text
 dependencies:
   config:
diff --git a/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.entity_test.field_test_import_sync.yml b/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.entity_test.field_test_import_sync.yml
index 678c9fa19a..b8af4db0e3 100644
--- a/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.entity_test.field_test_import_sync.yml
+++ b/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.entity_test.field_test_import_sync.yml
@@ -9,7 +9,8 @@ description: ''
 required: '0'
 default_value: {  }
 default_value_callback: ''
-settings: { }
+settings:
+  allowed_formats: {  }
 field_type: text
 dependencies:
   config:
diff --git a/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.test_bundle.field_test_import_sync_2.yml b/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.test_bundle.field_test_import_sync_2.yml
index e483418f93..1f8f54fcba 100644
--- a/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.test_bundle.field_test_import_sync_2.yml
+++ b/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.test_bundle.field_test_import_sync_2.yml
@@ -9,7 +9,8 @@ description: ''
 required: '0'
 default_value: {  }
 default_value_callback: ''
-settings: { }
+settings:
+  allowed_formats: {  }
 field_type: text
 dependencies:
   config:
diff --git a/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.test_bundle_2.field_test_import_sync_2.yml b/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.test_bundle_2.field_test_import_sync_2.yml
index 3afd2e255c..bc68be6378 100644
--- a/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.test_bundle_2.field_test_import_sync_2.yml
+++ b/core/modules/field/tests/modules/field_test_config/sync/field.field.entity_test.test_bundle_2.field_test_import_sync_2.yml
@@ -9,7 +9,8 @@ description: ''
 required: '0'
 default_value: {  }
 default_value_callback: ''
-settings: { }
+settings:
+  allowed_formats: {  }
 field_type: text
 dependencies:
   config:
diff --git a/core/modules/field/tests/src/Functional/Rest/FieldConfigResourceTestBase.php b/core/modules/field/tests/src/Functional/Rest/FieldConfigResourceTestBase.php
index def98a89e3..2f2f6436c9 100644
--- a/core/modules/field/tests/src/Functional/Rest/FieldConfigResourceTestBase.php
+++ b/core/modules/field/tests/src/Functional/Rest/FieldConfigResourceTestBase.php
@@ -82,7 +82,9 @@ protected function getExpectedNormalizedEntity() {
       'label' => 'field_llama',
       'langcode' => 'en',
       'required' => FALSE,
-      'settings' => [],
+      'settings' => [
+        'allowed_formats' => [],
+      ],
       'status' => TRUE,
       'translatable' => TRUE,
       'uuid' => $this->entity->uuid(),
diff --git a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceTest.php b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceTest.php
index fd33e56b24..9b1cde77d7 100644
--- a/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceTest.php
+++ b/core/modules/field/tests/src/Kernel/Migrate/d6/MigrateFieldInstanceTest.php
@@ -31,7 +31,7 @@ public function testFieldInstanceMigration() {
     $field = FieldConfig::load('node.story.field_test');
     $this->assertIdentical('Text Field', $field->label());
     // field_test is a text_long field, which have no settings.
-    $this->assertIdentical([], $field->getSettings());
+    $this->assertIdentical(['allowed_formats' => []], $field->getSettings());
     $this->assertIdentical('text for default value', $entity->field_test->value);
 
     // Test a number field.
diff --git a/core/modules/forum/config/optional/field.field.comment.comment_forum.comment_body.yml b/core/modules/forum/config/optional/field.field.comment.comment_forum.comment_body.yml
index 215199cc22..8c6fa4c571 100644
--- a/core/modules/forum/config/optional/field.field.comment.comment_forum.comment_body.yml
+++ b/core/modules/forum/config/optional/field.field.comment.comment_forum.comment_body.yml
@@ -16,5 +16,6 @@ required: true
 translatable: true
 default_value: {  }
 default_value_callback: ''
-settings: {  }
+settings:
+  allowed_formats: {  }
 field_type: text_long
diff --git a/core/modules/forum/config/optional/field.field.node.forum.body.yml b/core/modules/forum/config/optional/field.field.node.forum.body.yml
index 4289cdb2b2..ac1fa82a5d 100644
--- a/core/modules/forum/config/optional/field.field.node.forum.body.yml
+++ b/core/modules/forum/config/optional/field.field.node.forum.body.yml
@@ -19,4 +19,5 @@ default_value_callback: ''
 settings:
   display_summary: true
   required_summary: false
+  allowed_formats: {  }
 field_type: text_with_summary
diff --git a/core/modules/inline_form_errors/tests/src/FunctionalJavascript/FormErrorHandlerCKEditorTest.php b/core/modules/inline_form_errors/tests/src/FunctionalJavascript/FormErrorHandlerCKEditorTest.php
index b50297eee5..414ceda763 100644
--- a/core/modules/inline_form_errors/tests/src/FunctionalJavascript/FormErrorHandlerCKEditorTest.php
+++ b/core/modules/inline_form_errors/tests/src/FunctionalJavascript/FormErrorHandlerCKEditorTest.php
@@ -61,7 +61,10 @@ protected function setUp(): void {
       'field_storage' => $field_storage,
       'bundle' => 'page',
       'label' => 'Body',
-      'settings' => ['display_summary' => TRUE],
+      'settings' => [
+        'display_summary' => TRUE,
+        'allowed_formats' => [],
+      ],
       'required' => TRUE,
     ])->save();
 
diff --git a/core/modules/jsonapi/tests/src/Functional/FieldConfigTest.php b/core/modules/jsonapi/tests/src/Functional/FieldConfigTest.php
index a1cb1f002c..1835dfc654 100644
--- a/core/modules/jsonapi/tests/src/Functional/FieldConfigTest.php
+++ b/core/modules/jsonapi/tests/src/Functional/FieldConfigTest.php
@@ -119,7 +119,7 @@ protected function getExpectedDocument() {
           'label' => 'field_llama',
           'langcode' => 'en',
           'required' => FALSE,
-          'settings' => [],
+          'settings' => ['allowed_formats' => []],
           'status' => TRUE,
           'translatable' => TRUE,
           'drupal_internal__id' => 'node.camelids.field_llama',
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 31b1143372..b6e0cb4f3e 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -268,7 +268,10 @@ function node_add_body_field(NodeTypeInterface $type, $label = 'Body') {
       'field_storage' => $field_storage,
       'bundle' => $type->id(),
       'label' => $label,
-      'settings' => ['display_summary' => TRUE],
+      'settings' => [
+        'display_summary' => TRUE,
+        'allowed_formats' => [],
+      ],
     ]);
     $field->save();
 
diff --git a/core/modules/options/tests/options_config_install_test/config/install/field.field.node.options_install_test.body.yml b/core/modules/options/tests/options_config_install_test/config/install/field.field.node.options_install_test.body.yml
index 2078a84485..ac288b88f3 100644
--- a/core/modules/options/tests/options_config_install_test/config/install/field.field.node.options_install_test.body.yml
+++ b/core/modules/options/tests/options_config_install_test/config/install/field.field.node.options_install_test.body.yml
@@ -16,5 +16,6 @@ default_value: {  }
 default_value_callback: ''
 settings:
   display_summary: true
+  allowed_formats: {  }
 third_party_settings: {  }
 field_type: text_with_summary
diff --git a/core/modules/text/config/schema/text.schema.yml b/core/modules/text/config/schema/text.schema.yml
index 08bc9aad87..40be366b6d 100644
--- a/core/modules/text/config/schema/text.schema.yml
+++ b/core/modules/text/config/schema/text.schema.yml
@@ -19,6 +19,12 @@ field.storage_settings.text:
 field.field_settings.text:
   type: mapping
   label: 'Text (formatted) settings'
+  mapping:
+    allowed_formats:
+      type: sequence
+      label: 'Allowed text formats'
+      sequence:
+        type: string
 
 field.value.text:
   type: mapping
@@ -38,6 +44,12 @@ field.storage_settings.text_long:
 field.field_settings.text_long:
   label: 'Text (formatted, long) settings'
   type: mapping
+  mapping:
+    allowed_formats:
+      type: sequence
+      label: 'Allowed text formats'
+      sequence:
+        type: string
 
 field.value.text_long:
   type: mapping
@@ -64,6 +76,11 @@ field.field_settings.text_with_summary:
     required_summary:
       type: boolean
       label: 'Require summary'
+    allowed_formats:
+      type: sequence
+      label: 'Allowed text formats'
+      sequence:
+        type: string
 
 field.value.text_with_summary:
   type: mapping
diff --git a/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php b/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php
index e70fadacb1..d923f1ba4f 100644
--- a/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php
+++ b/core/modules/text/src/Plugin/Field/FieldType/TextItemBase.php
@@ -7,12 +7,66 @@
 use Drupal\Core\Field\FieldItemBase;
 use Drupal\Core\Field\FieldStorageDefinitionInterface;
 use Drupal\Core\TypedData\DataDefinition;
+use Drupal\Core\Form\FormStateInterface;
 
 /**
  * Base class for 'text' configurable field types.
  */
 abstract class TextItemBase extends FieldItemBase {
 
+  /**
+   * {@inheritdoc}
+   */
+  public static function defaultFieldSettings() {
+    return ['allowed_formats' => []] + parent::defaultFieldSettings();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
+    $element = parent::fieldSettingsForm($form, $form_state);
+    $settings = $this->getSettings();
+
+    $element['allowed_formats'] = [
+      '#type' => 'checkboxes',
+      '#title' => $this->t('Allowed text formats'),
+      '#options' => $this->get('format')->getPossibleOptions(),
+      '#default_value' => $settings['allowed_formats'],
+      '#description' => $this->t('Select the allowed text formats. If no formats are selected, all available text formats will be displayed to the user.'),
+      '#element_validate' => [[static::class, 'validateAllowedFormats']],
+    ];
+
+    return $element;
+  }
+
+  /**
+   * Render API callback: Processes the allowed formats value.
+   *
+   * Ensure the element's value is an indexed array of selected format IDs.
+   *
+   * This function is assigned as an #element_validate callback in
+   * ::fieldSettingsForm().
+   */
+  public static function validateAllowedFormats(array &$element, FormStateInterface $form_state) {
+    $value = array_values(array_filter($element['#value']));
+    $form_state->setValueForElement($element, $value);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function calculateDependencies(FieldDefinitionInterface $field_definition) {
+    // Add explicitly allowed formats as config dependencies.
+    $dependencies = parent::calculateDependencies($field_definition);
+    $format_dependencies = array_map(function (string $format_id) {
+      return 'filter.format.' . $format_id;
+    }, $field_definition->getSetting('allowed_formats'));
+    $config = $dependencies['config'] ?? [];
+    $dependencies['config'] = array_merge($config, $format_dependencies);
+    return $dependencies;
+  }
+
   /**
    * {@inheritdoc}
    */
diff --git a/core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php b/core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php
index 9c9a160e23..06fb1d9186 100644
--- a/core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php
+++ b/core/modules/text/src/Plugin/Field/FieldType/TextWithSummaryItem.php
@@ -86,7 +86,7 @@ public function isEmpty() {
    * {@inheritdoc}
    */
   public function fieldSettingsForm(array $form, FormStateInterface $form_state) {
-    $element = [];
+    $element = parent::fieldSettingsForm($form, $form_state);
     $settings = $this->getSettings();
 
     $element['display_summary'] = [
diff --git a/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWidget.php b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWidget.php
index 11e84f1c3e..1c3a224e6c 100644
--- a/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWidget.php
+++ b/core/modules/text/src/Plugin/Field/FieldWidget/TextareaWidget.php
@@ -34,11 +34,17 @@ public function settingsForm(array $form, FormStateInterface $form_state) {
    */
   public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $main_widget = parent::formElement($items, $delta, $element, $form, $form_state);
+    $allowed_formats = $this->getFieldSetting('allowed_formats');
 
     $element = $main_widget['value'];
     $element['#type'] = 'text_format';
     $element['#format'] = $items[$delta]->format;
     $element['#base_type'] = $main_widget['value']['#type'];
+
+    if ($allowed_formats && !$this->isDefaultValueWidget($form_state)) {
+      $element['#allowed_formats'] = $allowed_formats;
+    }
+
     return $element;
   }
 
diff --git a/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php b/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php
index 8f4c73ba69..b7c9ef91c9 100644
--- a/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php
+++ b/core/modules/text/src/Plugin/Field/FieldWidget/TextfieldWidget.php
@@ -25,11 +25,17 @@ class TextfieldWidget extends StringTextfieldWidget {
    */
   public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
     $main_widget = parent::formElement($items, $delta, $element, $form, $form_state);
+    $allowed_formats = $this->getFieldSetting('allowed_formats');
 
     $element = $main_widget['value'];
     $element['#type'] = 'text_format';
     $element['#format'] = isset($items[$delta]->format) ? $items[$delta]->format : NULL;
     $element['#base_type'] = $main_widget['value']['#type'];
+
+    if ($allowed_formats && !$this->isDefaultValueWidget($form_state)) {
+      $element['#allowed_formats'] = $allowed_formats;
+    }
+
     return $element;
   }
 
diff --git a/core/modules/text/tests/src/Functional/TextFieldTest.php b/core/modules/text/tests/src/Functional/TextFieldTest.php
index 78cfb7a777..3a7e68fa0a 100644
--- a/core/modules/text/tests/src/Functional/TextFieldTest.php
+++ b/core/modules/text/tests/src/Functional/TextFieldTest.php
@@ -153,6 +153,97 @@ public function testTextfieldWidgetsFormatted() {
     $this->_testTextfieldWidgetsFormatted('text_long', 'text_textarea');
   }
 
+  /**
+   * Test widgets for fields with selected allowed formats.
+   */
+  public function testTextfieldWidgetsAllowedFormats() {
+    // Create one text format.
+    $this->drupalLogin($this->adminUser);
+    $edit = [
+      'format' => mb_strtolower($this->randomMachineName()),
+      'name' => $this->randomMachineName(),
+    ];
+    $this->drupalGet('admin/config/content/formats/add');
+    $this->submitForm($edit, 'Save configuration');
+    filter_formats_reset();
+    /** @var \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager */
+    $entity_type_manager = $this->container->get('entity_type.manager');
+    $filter_format_storage = $entity_type_manager
+      ->getStorage('filter_format');
+    /** @var \Drupal\filter\Entity\FilterFormat $format1 */
+    $format1 = $filter_format_storage->load($edit['format']);
+
+    // Create a second text format.
+    $edit = [
+      'format' => mb_strtolower($this->randomMachineName()),
+      'name' => $this->randomMachineName(),
+    ];
+    $this->drupalGet('admin/config/content/formats/add');
+    $this->submitForm($edit, 'Save configuration');
+    filter_formats_reset();
+    /** @var \Drupal\filter\Entity\FilterFormat $format2 */
+    $format2 = $filter_format_storage->load($edit['format']);
+
+    // Grant access to both formats to the user.
+    $roles = $this->webUser->getRoles();
+    $rid = $roles[0];
+    user_role_grant_permissions($rid, [
+      $format1->getPermissionName(),
+      $format2->getPermissionName(),
+    ]);
+
+    // Create a field with multiple formats allowed.
+    $field_name = mb_strtolower($this->randomMachineName());
+    $field_storage = FieldStorageConfig::create([
+      'field_name' => $field_name,
+      'entity_type' => 'entity_test',
+      'type' => 'text',
+    ]);
+    $field_storage->save();
+    $field = FieldConfig::create([
+      'field_storage' => $field_storage,
+      'bundle' => 'entity_test',
+      'label' => $this->randomMachineName() . '_label',
+      'settings' => ['allowed_formats' => [$format1->id(), $format2->id()]],
+    ]);
+    $field->save();
+
+    /** @var \Drupal\Core\Entity\EntityDisplayRepositoryInterface $entity_display_repository */
+    $entity_display_repository = $this->container->get('entity_display.repository');
+    $entity_display_repository->getFormDisplay('entity_test', 'entity_test', 'default')
+      ->setComponent($field_name, [
+        'type' => 'text_textfield',
+      ])
+      ->save();
+    $entity_display_repository->getViewDisplay('entity_test', 'entity_test', 'full')
+      ->setComponent($field_name)
+      ->save();
+
+    // Display the creation form.
+    $this->drupalLogin($this->webUser);
+    $this->drupalGet('entity_test/add');
+    $this->assertSession()->fieldExists("{$field_name}[0][value]", NULL);
+    $this->assertSession()->optionExists("{$field_name}[0][format]", $format1->id());
+    $this->assertSession()->optionExists("{$field_name}[0][format]", $format2->id());
+
+    // Change field to allow only one format.
+    $field->setSetting('allowed_formats', [$format1->id()]);
+    $field->save();
+    // We shouldn't have the 'format' selector since only one format is allowed.
+    $this->drupalGet('entity_test/add');
+    $this->assertSession()->fieldExists("{$field_name}[0][value]", NULL);
+    $this->assertSession()->fieldNotExists("{$field_name}[0][format]");
+
+    // Change field to allow all formats by configuring none as allowed.
+    $field->setSetting('allowed_formats', []);
+    $field->save();
+    $this->drupalGet('entity_test/add');
+    // We should see the 'format' selector again.
+    $this->assertSession()->fieldExists("{$field_name}[0][value]", NULL);
+    $this->assertSession()->optionExists("{$field_name}[0][format]", $format1->id());
+    $this->assertSession()->optionExists("{$field_name}[0][format]", $format2->id());
+  }
+
   /**
    * Helper function for testTextfieldWidgetsFormatted().
    */
@@ -196,7 +287,7 @@ public function _testTextfieldWidgetsFormatted($field_type, $widget_type) {
     // Display the creation form. Since the user only has access to one format,
     // no format selector will be displayed.
     $this->drupalGet('entity_test/add');
-    $this->assertSession()->fieldValueEquals("{$field_name}[0][value]", '');
+    $this->assertSession()->fieldValueEquals("{$field_name}[0][value]", NULL);
     $this->assertSession()->fieldNotExists("{$field_name}[0][format]");
 
     // Submit with data that should be filtered.
diff --git a/core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php b/core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php
index 0c52a1452a..a2a8bfe617 100644
--- a/core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php
+++ b/core/modules/views/tests/src/Kernel/Entity/ViewEntityDependenciesTest.php
@@ -80,7 +80,10 @@ protected function setUp($import_test_views = TRUE): void {
       'field_storage' => FieldStorageConfig::loadByName('node', 'body'),
       'bundle' => $content_type->id(),
       'label' => $this->randomMachineName() . '_body',
-      'settings' => ['display_summary' => TRUE],
+      'settings' => [
+        'display_summary' => TRUE,
+        'allowed_formats' => [],
+      ],
     ])->save();
 
     ViewTestData::createTestViews(static::class, ['views_test_config']);
diff --git a/core/profiles/demo_umami/config/install/field.field.block_content.basic.body.yml b/core/profiles/demo_umami/config/install/field.field.block_content.basic.body.yml
index dab4f98181..40968daa4d 100644
--- a/core/profiles/demo_umami/config/install/field.field.block_content.basic.body.yml
+++ b/core/profiles/demo_umami/config/install/field.field.block_content.basic.body.yml
@@ -19,4 +19,5 @@ default_value_callback: ''
 settings:
   display_summary: false
   required_summary: false
+  allowed_formats: {  }
 field_type: text_with_summary
diff --git a/core/profiles/demo_umami/config/install/field.field.block_content.disclaimer_block.field_copyright.yml b/core/profiles/demo_umami/config/install/field.field.block_content.disclaimer_block.field_copyright.yml
index 964a88887c..30cbbdbb05 100644
--- a/core/profiles/demo_umami/config/install/field.field.block_content.disclaimer_block.field_copyright.yml
+++ b/core/profiles/demo_umami/config/install/field.field.block_content.disclaimer_block.field_copyright.yml
@@ -16,5 +16,6 @@ required: false
 translatable: true
 default_value: {  }
 default_value_callback: ''
-settings: {  }
+settings:
+  allowed_formats: {  }
 field_type: text_long
diff --git a/core/profiles/demo_umami/config/install/field.field.block_content.disclaimer_block.field_disclaimer.yml b/core/profiles/demo_umami/config/install/field.field.block_content.disclaimer_block.field_disclaimer.yml
index d2d3c91850..1aab290261 100644
--- a/core/profiles/demo_umami/config/install/field.field.block_content.disclaimer_block.field_disclaimer.yml
+++ b/core/profiles/demo_umami/config/install/field.field.block_content.disclaimer_block.field_disclaimer.yml
@@ -16,5 +16,6 @@ required: false
 translatable: true
 default_value: {  }
 default_value_callback: ''
-settings: {  }
+settings:
+  allowed_formats: {  }
 field_type: text_long
diff --git a/core/profiles/demo_umami/config/install/field.field.node.article.body.yml b/core/profiles/demo_umami/config/install/field.field.node.article.body.yml
index b36fbd5844..66f00ac4a5 100644
--- a/core/profiles/demo_umami/config/install/field.field.node.article.body.yml
+++ b/core/profiles/demo_umami/config/install/field.field.node.article.body.yml
@@ -19,4 +19,5 @@ default_value_callback: ''
 settings:
   display_summary: true
   required_summary: false
+  allowed_formats: {  }
 field_type: text_with_summary
diff --git a/core/profiles/demo_umami/config/install/field.field.node.page.body.yml b/core/profiles/demo_umami/config/install/field.field.node.page.body.yml
index 4ff17d0e71..c81d7034f3 100644
--- a/core/profiles/demo_umami/config/install/field.field.node.page.body.yml
+++ b/core/profiles/demo_umami/config/install/field.field.node.page.body.yml
@@ -19,4 +19,5 @@ default_value_callback: ''
 settings:
   display_summary: true
   required_summary: false
+  allowed_formats: {  }
 field_type: text_with_summary
diff --git a/core/profiles/demo_umami/config/install/field.field.node.recipe.field_recipe_instruction.yml b/core/profiles/demo_umami/config/install/field.field.node.recipe.field_recipe_instruction.yml
index ff090cac35..788f56d189 100644
--- a/core/profiles/demo_umami/config/install/field.field.node.recipe.field_recipe_instruction.yml
+++ b/core/profiles/demo_umami/config/install/field.field.node.recipe.field_recipe_instruction.yml
@@ -16,5 +16,6 @@ required: true
 translatable: true
 default_value: {  }
 default_value_callback: ''
-settings: {  }
+settings:
+  allowed_formats: {  }
 field_type: text_long
diff --git a/core/profiles/demo_umami/config/install/field.field.node.recipe.field_summary.yml b/core/profiles/demo_umami/config/install/field.field.node.recipe.field_summary.yml
index b648b97889..7ea393bc51 100644
--- a/core/profiles/demo_umami/config/install/field.field.node.recipe.field_summary.yml
+++ b/core/profiles/demo_umami/config/install/field.field.node.recipe.field_summary.yml
@@ -16,5 +16,6 @@ required: true
 translatable: true
 default_value: {  }
 default_value_callback: ''
-settings: {  }
+settings:
+  allowed_formats: {  }
 field_type: text_long
diff --git a/core/profiles/standard/config/install/field.field.block_content.basic.body.yml b/core/profiles/standard/config/install/field.field.block_content.basic.body.yml
index dab4f98181..40968daa4d 100644
--- a/core/profiles/standard/config/install/field.field.block_content.basic.body.yml
+++ b/core/profiles/standard/config/install/field.field.block_content.basic.body.yml
@@ -19,4 +19,5 @@ default_value_callback: ''
 settings:
   display_summary: false
   required_summary: false
+  allowed_formats: {  }
 field_type: text_with_summary
diff --git a/core/profiles/standard/config/install/field.field.comment.comment.comment_body.yml b/core/profiles/standard/config/install/field.field.comment.comment.comment_body.yml
index 1337070d16..8d97e03507 100644
--- a/core/profiles/standard/config/install/field.field.comment.comment.comment_body.yml
+++ b/core/profiles/standard/config/install/field.field.comment.comment.comment_body.yml
@@ -16,5 +16,6 @@ required: true
 translatable: true
 default_value: {  }
 default_value_callback: ''
-settings: {  }
+settings:
+  allowed_formats: {  }
 field_type: text_long
diff --git a/core/profiles/standard/config/install/field.field.node.article.body.yml b/core/profiles/standard/config/install/field.field.node.article.body.yml
index b36fbd5844..66f00ac4a5 100644
--- a/core/profiles/standard/config/install/field.field.node.article.body.yml
+++ b/core/profiles/standard/config/install/field.field.node.article.body.yml
@@ -19,4 +19,5 @@ default_value_callback: ''
 settings:
   display_summary: true
   required_summary: false
+  allowed_formats: {  }
 field_type: text_with_summary
diff --git a/core/profiles/standard/config/install/field.field.node.page.body.yml b/core/profiles/standard/config/install/field.field.node.page.body.yml
index 4ff17d0e71..c81d7034f3 100644
--- a/core/profiles/standard/config/install/field.field.node.page.body.yml
+++ b/core/profiles/standard/config/install/field.field.node.page.body.yml
@@ -19,4 +19,5 @@ default_value_callback: ''
 settings:
   display_summary: true
   required_summary: false
+  allowed_formats: {  }
 field_type: text_with_summary
