Cathleen Gary appeals the district court’s sua sponte dismissal of her pro se civil complaint as frivolous pursuant to 28 U.S.C. § 1915(e)(2)(B)(i). Gary filed a civil complaint against a number of high-level government officials, including President Barack Obama and various national intelligence agencies, asserting that they had implanted microchips into her body that caused tumors and tissue damage. She alleged that these microchips were used to conduct biomedical research regarding her reproductive system, to track her movements, and to cause her pain. She further alleged that the defendants drugged and assaulted her in order to cover up evidence of her damages, and that these assaults included invasive surgery, tissue removal, and inserting foreign objects into her body. Gary sought leave to proceed in forma pauperis (“IFP”), and she also filed *917a motion for injunctive relief and a motion for class action certification.
A magistrate judge issued an order and a report and recommendation (“R & R”), which granted Gary’s motion to proceed IFP. However, the magistrate judge determined that Gary’s allegations were “fanciful and delusional” and recommended dismissing her complaint pursuant to § 1915(e)(B)(i) and (ii) for frivolity and for failure to state a claim. Gary objected to the R & R, but the district court adopted the R & R as the order of the court. The court dismissed Gary’s complaint as frivolous and dismissed as moot Gary’s motion for an injunction and motion for class action certification.
On appeal, Gary asserts that the court abused its discretion in dismissing her complaint as frivolous because her allegations were not fanciful or removed from reality, and implantation of electronic devices is an action being litigated in the court system. She further argues that the court abused its discretion by sua sponte dismissing her complaint without providing her leave to amend, as she should have been allowed to cure any deficiencies in her complaint. She also asserts that she alleged sufficient facts to state a claim for relief.1
We review de novo a sua sponte dismissal for failure to state a claim under § 1915(e)(2)(B)(ii), and review for abuse of discretion a sua sponte dismissal as frivolous under § 1915(e)(2)(B)(i). Hughes v. Lott, 350 F.3d 1157, 1159-60 (11th Cir. 2003). We also review for abuse of discretion denials of leave to amend. Troville v. Venz, 303 F.3d 1256, 1259 (11th Cir.2002).
Section 1915(e)(2) of Title 28 of the ILS.Code states that a claim filed by a person proceeding informa pauperis shall be dismissed if the court determines the action or appeal is frivolous or malicious, or fails to state a claim upon which relief may be granted. 28 U.S.C. § 1915(e)(2)(B)®, (ii). A lawsuit is frivolous if it is “without arguable merit either in law or fact.” Napier v. Preslicka, 314 F.3d 528, 531 (11th Cir.2002) (internal quotation marks omitted). Dismissal for frivolity is warranted when a claim is based on an indisputably meritless legal theory, or when it relies on factual allegations that are “clearly baseless,” which includes allegations that are “fanciful,” “fantastic,” and “delusional.” Denton v. Hernandez, 504 U.S. 25, 32-33, 112 S.Ct. 1728, 1733, 118 L.Ed.2d 340 (1992) (internal quotation marks omitted). “[A] finding of factual frivolousness is appropriate when the facts alleged rise to the level of the irrational or the wholly incredible....” Id. at 33, 112 S.Ct. at 1733.
We have held that when a more carefully drafted complaint might state a claim, a plaintiff must be given at least one chance to amend the complaint before the district court dismisses the action with prejudice. Bank v. Pitt, 928 F.2d 1108, 1112 (11th Cir.1991), overruled in part by Wagner v. Daewoo Heavy Indus. Am. Corp., 314 F.3d 541, 542 & n. 1 (11th Cir.2002) (en banc) (holding that the court was not required to sua sponte grant leave to amend to counseled plaintiffs who never requested such leave, but noting that the holding did not disturb a pro se litigant’s right to amend). Although a pro se litigant generally should be permitted to amend her complaint, a district court need not allow amendment when it would be futile. Cockrell v. Sparks, 510 F.3d 1307, 1310 (11th Cir. *9182007). “Leave to amend a complaint is futile when the complaint as amended would still be properly dismissed or be immediately subject to summary judgment for the defendant.” Id.
We conclude from the record that the district court did not abuse its discretion in dismissing Gary’s complaint as frivolous, as a review of the complaint shows that her allegations were irrational and wholly incredible. Furthermore, we conclude that the district court did not abuse its discretion by not affording Gary an opportunity to amend her complaint because any amendment would have been futile, as none of Gary’s allegations are credible or rational.
Accordingly, we affirm the district court’s judgment of dismissal.
AFFIRMED.